Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3197224pxb; Sun, 31 Jan 2021 07:32:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhWiZSnkYQhG0AkxD0V5pUNlLpc4HFbgqFlzycv9Kd0Qp++PZwLOy02i58iXM71Z2wxQAI X-Received: by 2002:aa7:d288:: with SMTP id w8mr14508253edq.241.1612107133320; Sun, 31 Jan 2021 07:32:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612107133; cv=none; d=google.com; s=arc-20160816; b=l/R5omtrWuTVsa1hpLbJ6iJZ+aTUr2r2zl7ruhdfl0C3dk2nEsciH21s5DtQLCTDxR CTjJBf7/hYsUpSR7v+P4sAi4wwu26VgNWa6l5UH7dWyFckRfFERIYnpRUhGhWrSOPW4b 8c4OqYYshMyZtRqJV8/PdLH6tG8wb20hqtph/SFUwbswv/POHbC5IScdOq+XaCV/0gH0 XyRYUSJqrXhgm6DmbMuXceQvOJHpwBWWuRP4SA2xDlofFK2OO7wDWmqsYjY4edY+o6pF VTFG98kTl+UJCmQyjT2frXsIkQKSnhnBMzojxzXuMySKQWv+qYQiZAU3KcsfWuk5FTCo dbyg== 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=m6D9AVfQtCACHDFLzMC2+dKDeTqDQd1nshm0jT7f5EaGoHu5nldF+Dc0IaXy6hgqqM 3nUEDyMlih1EkUvidUt+Io74jnT1RmFqXjyLcf2ZnClW69AjbiZ/eQEnqBszIgoEpDxi cCohPYZMuOi02O6FW9cI0SkSWNXwPr4mHzF40GfqGFvV64dW65/w77bnGTuQzVpyVzHA OCrdeRkQFysWYyIKbVpEh2MMzqB4+zaXxZGdna6IE2GJSAbTrCB/08PPcJW6JU1sGsal RxQnT2v3pGTrbagOP7QpdgbO8UuOBEhgOPoy8Im/l/KWB/VAtWv+a45M+qJqjRfo4S+/ LRxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=E+7p+Wcl; 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 x1si598238eds.502.2021.01.31.07.31.48; Sun, 31 Jan 2021 07:32:13 -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=E+7p+Wcl; 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 S232761AbhAaNzc (ORCPT + 99 others); Sun, 31 Jan 2021 08:55:32 -0500 Received: from mail-41103.protonmail.ch ([185.70.41.103]:56598 "EHLO mail-41103.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbhAaMYU (ORCPT ); Sun, 31 Jan 2021 07:24:20 -0500 Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 1C2E72000951 for ; Sun, 31 Jan 2021 12:16:40 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="E+7p+Wcl" Date: Sun, 31 Jan 2021 12:12:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1612095132; bh=vZbokY1lR2yxpQh6llA40AYewCXOK6n7Mk2VaFMgqMw=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=E+7p+WclLnclb9/oXHSDVoy6bFsJ1HSU47SI8Jc5wa3Kih9aIB5JxLhPcmKFpy52l qFa2Fz5CZNEED9xa3g8SQz9+PfHtZexOUS99c8IUt9IlrHwr9SNTuuEsGMDfvl2KwK 8LKh4Dymt71B5fNFJJyG24viVvjiwURtgHKAU22XhC0NS6E4Lx93gdcWRs2qAhK57C KDCReaX4JoYHy7l/R0JT3HV8dtTzED4kQ+LZqboAAjFhgzTzb8nyMngy5c+jyYy8ol aDK45oeEX5yxhRE77Y1ODbcgk7WQ+oLLUk1a9ZS7LDhwbg9pocnvE6Wb1t+ynFoOmr TU7OY3sQLSa1w== 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 v3 net-next 5/5] net: page_pool: simplify page recycling condition tests Message-ID: <20210131120844.7529-6-alobakin@pm.me> In-Reply-To: <20210131120844.7529-1-alobakin@pm.me> References: <20210131120844.7529-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