Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp629282pxb; Tue, 2 Feb 2021 13:42:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzO0yyGniBA+mqxuH79xRSbbwIikBxLwqbHoVl2gGqbgFIcO+44+VY3+C8/dXIx3zzsxT5+ X-Received: by 2002:a50:a684:: with SMTP id e4mr121580edc.148.1612302177459; Tue, 02 Feb 2021 13:42:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612302177; cv=none; d=google.com; s=arc-20160816; b=P3/V93bm283YCpQH3bpXtC5/n861hUPene52kOTuJPLbDt7FENLegCu7Fim1PsL+px j0At41BfaBpAtOvJrFa12H/uIIvEdMwfw6BtXZAOiU/WH5lrLl0qUzaylpTx5FHDTI/B FF2g2nOxKAhpoBE3w4c50udKgB9XgYxTyCy4zHBtRrCqNCG9xPE7hfNwDsvytVUB9MJr 0StlmaytxSsutnry3m0inPMP++LzD9LVxXI8Ab3TUlKy9+wJyDy+spWXcWsrhLbnzyak G+cjDhXezLjYGC01BN6LD5cQv9WfKPJTe6AOMqmrimrKqnk21hoTnB2nbFlJMzukF9gD kF6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=vZbokY1lR2yxpQh6llA40AYewCXOK6n7Mk2VaFMgqMw=; b=T29vAGmkbXcWbyPOzGHrVQdp5Lys5KvWwCi/U8l3ONa8yB2SgXf6IVUSG2TQCr9OPT TKmd8zmUxgiMpYas7c8lyA92hlkX2o9Fh5xW2xJPaS7V1MGtUsyW9jEzLlyp2eOEB/K4 DTEqNqYGis5UPMCvMc230vyOuxxTfJfMbg+WSmUewNTDt+zD/ASlMFBdH3KTiJSf+u8c j4bkEEDtuYXH2vY33xORZBW9gzVtlvZLMbITb9E4VcX74V6p9yGT/ts34AsWOMrxen1/ XmjhuXfmKiXg8HyNcddyMC0hL8XYWUu0W3AAifyOV1LTF6HpRAtlSGjHlRas8yFj4EQY 5yHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=RRCmGVsk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n19si55014ejh.295.2021.02.02.13.42.21; Tue, 02 Feb 2021 13:42:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=RRCmGVsk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232425AbhBBNio (ORCPT + 99 others); Tue, 2 Feb 2021 08:38:44 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:42137 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232465AbhBBNcf (ORCPT ); Tue, 2 Feb 2021 08:32:35 -0500 Date: Tue, 02 Feb 2021 13:31:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1612272712; bh=vZbokY1lR2yxpQh6llA40AYewCXOK6n7Mk2VaFMgqMw=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=RRCmGVskxM06gir97O7queRXOrVsD1PbQYwYmdjmasUHdSgRJtvjy4r1a/w9vJWod ENfzjQZIQra+3Uu+sb2b/AGrWNGfUFCdKdLumzIET/EPyGkKOXRnG/+nn7CxPYrn5X YUfPyaII0uz68enCelJu5xkK0G1fcAadDMvQxEzpCIf3RCNLZflqjaS2dyRtgPrmhE thQG2gWWC/x5zvoR0aK1LdGvEpX/cL0Po5BSl3RW7wUZCAZHIUhmIltAUHz2axkXII VzA6rDXzez0UwdoV4Aisj3GM2rCpsePvKMLF1kq92AOUtI9Vi25l2P7aF1OkM+35mh hn1emmwkIP4mQ== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: John Hubbard , David Rientjes , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Saeed Mahameed , Leon Romanovsky , Andrew Morton , Jesper Dangaard Brouer , Ilias Apalodimas , Jonathan Lemon , Willem de Bruijn , Randy Dunlap , Pablo Neira Ayuso , Dexuan Cui , Jakub Sitnicki , Marco Elver , Paolo Abeni , Alexander Lobakin , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org Reply-To: Alexander Lobakin Subject: [PATCH RESEND v3 net-next 5/5] net: page_pool: simplify page recycling condition tests Message-ID: <20210202133030.5760-6-alobakin@pm.me> In-Reply-To: <20210202133030.5760-1-alobakin@pm.me> References: <20210202133030.5760-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pool_page_reusable() is a leftover from pre-NUMA-aware times. For now, this function is just a redundant wrapper over page_is_pfmemalloc(), so inline it into its sole call site. Signed-off-by: Alexander Lobakin Acked-by: Jesper Dangaard Brouer Reviewed-by: Ilias Apalodimas Reviewed-by: Jesse Brandeburg Acked-by: David Rientjes --- net/core/page_pool.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/net/core/page_pool.c b/net/core/page_pool.c index f3c690b8c8e3..ad8b0707af04 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -350,14 +350,6 @@ static bool page_pool_recycle_in_cache(struct page *pa= ge, =09return true; } =20 -/* page is NOT reusable when: - * 1) allocated when system is under some pressure. (page_is_pfmemalloc) - */ -static bool pool_page_reusable(struct page_pool *pool, struct page *page) -{ -=09return !page_is_pfmemalloc(page); -} - /* If the page refcnt =3D=3D 1, this will try to recycle the page. * if PP_FLAG_DMA_SYNC_DEV is set, we'll try to sync the DMA area for * the configured size min(dma_sync_size, pool->max_len). @@ -373,9 +365,11 @@ __page_pool_put_page(struct page_pool *pool, struct pa= ge *page, =09 * regular page allocator APIs. =09 * =09 * refcnt =3D=3D 1 means page_pool owns page, and can recycle it. +=09 * +=09 * page is NOT reusable when allocated when system is under +=09 * some pressure. (page_is_pfmemalloc) =09 */ -=09if (likely(page_ref_count(page) =3D=3D 1 && -=09=09 pool_page_reusable(pool, page))) { +=09if (likely(page_ref_count(page) =3D=3D 1 && !page_is_pfmemalloc(page)))= { =09=09/* Read barrier done in page_ref_count / READ_ONCE */ =20 =09=09if (pool->p.flags & PP_FLAG_DMA_SYNC_DEV) --=20 2.30.0