From patchwork Tue Nov 12 22:21:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Dalton X-Patchwork-Id: 290785 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 1777E2C00C8 for ; Wed, 13 Nov 2013 09:21:56 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757350Ab3KLWVw (ORCPT ); Tue, 12 Nov 2013 17:21:52 -0500 Received: from mail-ie0-f201.google.com ([209.85.223.201]:44777 "EHLO mail-ie0-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757013Ab3KLWVu (ORCPT ); Tue, 12 Nov 2013 17:21:50 -0500 Received: by mail-ie0-f201.google.com with SMTP id x13so1007560ief.0 for ; Tue, 12 Nov 2013 14:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sDIYPBMBK2y5E87Lh9SwqH7mlMyWwlZnj8FEjNIkbGY=; b=gY0pY/Q2DKFwH4gK/v1et5jWhOfQo+iTF2j3w88lBCIgsexCTZVSUpN6tv7zZP2ah1 gEVFU0xGZw/nNr6Zv1w5NLhzT2C2kai19HR+1A5CvIgYF2IVUojvIb/yK5XQj6vl7+z3 k9E2ZJWGLhrOCe5n/HH7Pz7eNywJcloo7QTmQ6F5pyKEejxgbakwv0hpbC/V7uaoAKIf XodHT2tXPTKo5peVPSLWQDS103cCBh+CpoD1qmhSCJSzOvZwppFPrzG0o217vWFutHuA +zR3TnEbujzpgW6d/X3cIC/RtSTGNYtwAtB3lKEq3dodLLp5cAvVpwiwjRVT14Ul/Hwx 7T8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sDIYPBMBK2y5E87Lh9SwqH7mlMyWwlZnj8FEjNIkbGY=; b=VG6oM8GNxHOcX3smR/LnO4DXJcgNBNxsAGPI2mRO+pTscBoPaT0uR7ZhcPrNd/tfL9 f9BAMI/LrNZyG2wRj0b4G5Drtls8FcMfcVX7T4foNI1Q2u4daeyR1sZZfU2+LeWkt+YA gxxVUs2Np0ouK8MYpSdrGQrasqvVE0841XgU6uG41EH3BVRDOtzOJddHlf7E/lmKMg68 I3/p+NrjrMpE11D9EfAhtlfDMNuyGJ7phmCDzMze02HsYJt9UEQrj2mWhQZOGivZjilB bhUM+SrIdcmYwHoowsXh/SxPoGAlncidddlBQ2WoBpAHGNR5EWIpajmBw7rsVEJ5NRfX OWyQ== X-Gm-Message-State: ALoCoQm/ABRvYNGJHw3NX8LeY1es7LIn5Zmu1mcdWXxl9hIj4Iz84OEwOiv6jvurdJ2nqYDeXli0GLcjHvRuUbKzaXR9RCBM02I6PUCTCYuDX/KiAHkte2Yt4gwairi0R6JTAxjyLx2EGs94tbU1QyRSSvvw8NOW4uLXpntbn32EY5wuqmsL+buk3zM2lkKL7p5IeqIsXymK5+ZHjPPgISvs/CRQKg15hA== X-Received: by 10.50.122.100 with SMTP id lr4mr8406103igb.0.1384294907929; Tue, 12 Nov 2013 14:21:47 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id c8si2387268yhk.7.2013.11.12.14.21.47 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 Nov 2013 14:21:47 -0800 (PST) Received: from midgard.mtv.corp.google.com (midgard.mtv.corp.google.com [172.18.126.13]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id B89085A4219; Tue, 12 Nov 2013 14:21:47 -0800 (PST) Received: by midgard.mtv.corp.google.com (Postfix, from userid 157258) id 7B30DE0883; Tue, 12 Nov 2013 14:21:47 -0800 (PST) From: Michael Dalton To: "David S. Miller" Cc: netdev@vger.kernel.org, Eric Dumazet , Rusty Russell , "Michael S. Tsirkin" , Daniel Borkmann , Jason Wang , Eric Northup , virtualization@lists.linux-foundation.org, Michael Dalton Subject: [PATCH net-next 2/4] net: allow > 0 order atomic page alloc in skb_page_frag_refill Date: Tue, 12 Nov 2013 14:21:23 -0800 Message-Id: <1384294885-6444-2-git-send-email-mwdalton@google.com> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1384294885-6444-1-git-send-email-mwdalton@google.com> References: <1384294885-6444-1-git-send-email-mwdalton@google.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org skb_page_frag_refill currently permits only order-0 page allocs unless GFP_WAIT is used. Change skb_page_frag_refill to attempt higher-order page allocations whether or not GFP_WAIT is used. If memory cannot be allocated, the allocator will fall back to successively smaller page allocs (down to order-0 page allocs). This change brings skb_page_frag_refill in line with the existing page allocation strategy employed by netdev_alloc_frag, which attempts higher-order page allocations whether or not GFP_WAIT is set, falling back to successively lower-order page allocations on failure. Part of migration of virtio-net to per-receive queue page frag allocators. Signed-off-by: Michael Dalton Acked-by: Eric Dumazet --- net/core/sock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/core/sock.c b/net/core/sock.c index ab20ed9..7383d23 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1865,9 +1865,7 @@ bool skb_page_frag_refill(unsigned int sz, struct page_frag *pfrag, gfp_t prio) put_page(pfrag->page); } - /* We restrict high order allocations to users that can afford to wait */ - order = (prio & __GFP_WAIT) ? SKB_FRAG_PAGE_ORDER : 0; - + order = SKB_FRAG_PAGE_ORDER; do { gfp_t gfp = prio;