From patchwork Fri Jan 3 22:47:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Debabrata Banerjee X-Patchwork-Id: 306684 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 505692C0098 for ; Sat, 4 Jan 2014 09:47:40 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754194AbaACWrW (ORCPT ); Fri, 3 Jan 2014 17:47:22 -0500 Received: from mail-oa0-f50.google.com ([209.85.219.50]:41502 "EHLO mail-oa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754181AbaACWrV (ORCPT ); Fri, 3 Jan 2014 17:47:21 -0500 Received: by mail-oa0-f50.google.com with SMTP id n16so16873076oag.9 for ; Fri, 03 Jan 2014 14:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=eJGQ7e/PpTn6NGinmqwNXGpRTSvaf5wbq3y6GxDTIAo=; b=DZNW/tCON8OhTaizWelmuzYZCvPic0Cu5tVhn/4NQMA4cnL1KuuHfG1oh9JbmtZ+yd BxuUFR1f1gG3VYX/uxOUZEdxSCXvRIrqesRJccCy8Wcj/WVI4/UkVSArACaHsa4wqoa4 sIyKFRBnw0pRKM0wLJDjKYubiaKgb8vFqsdAr36aHni3EXzbm+2Pr7rJ+0VJKX5mJ4kG z4+8Gq+znNS91MUdT/13CHuOAkQ3iuWToFKtTESxabS6nWrOAtmaGa6lLhyFQRxjsUKC JKzUPd8a1XWVZzJR29eRybkdminb5YwLMKMq+B8nhHvTn8HaRw7/o7i/vZdFvd8tkSpe jNnQ== MIME-Version: 1.0 X-Received: by 10.182.16.33 with SMTP id c1mr61617183obd.4.1388789240669; Fri, 03 Jan 2014 14:47:20 -0800 (PST) Received: by 10.76.125.104 with HTTP; Fri, 3 Jan 2014 14:47:20 -0800 (PST) In-Reply-To: References: <1387239389-13216-1-git-send-email-mwdalton@google.com> <20131224.174647.2276571374631580479.davem@davemloft.net> <1388710591.12212.110.camel@edumazet-glaptop2.roam.corp.google.com> <1388712396.12212.112.camel@edumazet-glaptop2.roam.corp.google.com> Date: Fri, 3 Jan 2014 17:47:20 -0500 Message-ID: Subject: Re: [PATCH net-next 1/3] net: allow > 0 order atomic page alloc in skb_page_frag_refill From: Debabrata Banerjee To: Eric Dumazet Cc: David Miller , Eric Dumazet , Michael Dalton , "netdev@vger.kernel.org" , Rusty Russell , mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, "Banerjee, Debabrata" , jbaron@akamai.com, Joshua Hunt Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org >> On Thu, 2014-01-02 at 16:56 -0800, Eric Dumazet wrote: >> >> Hmm... it looks like I missed __GFP_NORETRY >> >> >> >> diff --git a/net/core/sock.c b/net/core/sock.c >> index 5393b4b719d7..5f42a4d70cb2 100644 >> --- a/net/core/sock.c >> +++ b/net/core/sock.c >> @@ -1872,7 +1872,7 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio) >> gfp_t gfp = prio; >> >> if (order) >> - gfp |= __GFP_COMP | __GFP_NOWARN; >> + gfp |= __GFP_COMP | __GFP_NOWARN | __GFP_NORETRY; >> pfrag->page = alloc_pages(gfp, order); >> if (likely(pfrag->page)) { >> pfrag->offset = 0; >> >> >> There is another patch needed (looks like good stable fixes): break; This reduces the really pathological compact/reclaim behavior but doesn't fix it. Actually it still really quite bad because the whole thing loops until it gets to order-0 so it's effectively trying the allocation 4 times anyway. I typically see non-zero order allocations very rarely without these two pieces of code. I hotpatched a running system to get results from this quickly. Even setting the max order to order-1 I still see bad behavior. If anything this behavior should be conditional until this is ironed out. Performance data: http://pastebin.ubuntu.com/6687527/ -Debabrata --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 06e72d3..d42d48c 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -378,7 +378,7 @@ refill: gfp_t gfp = gfp_mask; if (order) - gfp |= __GFP_COMP | __GFP_NOWARN; + gfp |= __GFP_COMP | __GFP_NOWARN | __GFP_NORETRY; nc->frag.page = alloc_pages(gfp, order); if (likely(nc->frag.page))