Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3626806pxb; Mon, 25 Jan 2021 23:56:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjWAQuNRY8UJHH9BDo1Sg0OCF1vLaAFaKcErR6ohw9GcsS6TfEB358sCEHMooJNQlQC+fN X-Received: by 2002:a17:907:961d:: with SMTP id gb29mr2744611ejc.460.1611647805754; Mon, 25 Jan 2021 23:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611647805; cv=none; d=google.com; s=arc-20160816; b=fZnSqqM2p+w3VN0bOwlaP7bWbdmrmKush62lPqTRW0htvme8aNYIQdVaySvqscA8ru iZhtRQj5tp2CrinMmStohaNV7rXgqz0dCK/dsI2dqng3zmVnKq14V6/KYdKrRA4tSvVn +Np/McInVUcflaUM8Ew3SD3Ig6D5v4LbNeG5UZrTclUvpTgvsvrOjbkH4S/Lw9dY5/hI 2UxFwNmnrWjh3XFHe79GeSGS7GXrQBVzTf7OClaLza/IEM5WT/ot0m+IvPaShRavGJjU nQDtiqW7jsiW0X53QereYTacaZfJG5x7S+DntLZWrwpGVzNXCn5Cb12GOd2HP7yqJe/0 w9Vw== 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=PQjqCY1n/n+4wNCpUtWb3rQkV1Ny0cNm6fdbl7f6pik=; b=j62s7aMNWCti9x9BHB90FTiUSvqch+AcS3tMLSCXM7ypof+Fy58EE3Wi0xm2o/Zrz6 +46Ce4LopMVnmRrJgVYoeeVu8GqXVZhClMvB16obf2c9vVY5jk9qmKzDNbui1i69f7zC nibenFC+YI3ys/P0scGOD27ZzNkWiH3bdkpyzhkz0covzThknzJNkjvpPPrJQQMWWa34 I7n6E1sWxHMx7hp8q4qd7MXvfL5uJ97gwLcKSFpOLlbvVQchumSzI9n57PNBT60LOZgt fsbvUJrlyXce0riucNyCRYf4xFA5iym6pypvX+XVsSGGcshoE0+LxKxT90ZAHwyYgf10 1Xrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=QV6ZOPg0; 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 y10si6780872ejb.351.2021.01.25.23.56.20; Mon, 25 Jan 2021 23:56:45 -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=QV6ZOPg0; 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 S2389626AbhAZHys (ORCPT + 99 others); Tue, 26 Jan 2021 02:54:48 -0500 Received: from mail-40134.protonmail.ch ([185.70.40.134]:12324 "EHLO mail-40134.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730900AbhAYQsT (ORCPT ); Mon, 25 Jan 2021 11:48:19 -0500 Date: Mon, 25 Jan 2021 16:47:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1611593248; bh=PQjqCY1n/n+4wNCpUtWb3rQkV1Ny0cNm6fdbl7f6pik=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=QV6ZOPg0656nfl1DEH/S322UL4+pstgUgCc1D1CKk+HVHLbKEV+ewpATEWp5Q2eyp 0lsWNC9+XSddJ1LCqgvTPbHc+S6hYcR8A4hVYiJyLTitAeI7WF+1rsWLslrCAGkOX5 jEkHVWyb1P69/EUyfSsZLxVqP0CyMZ7v7Rm68NXplu9W1/G6howkrSHUKDizycGriX bKgyr8xwzvdhUKVpkxSpn5yG1ZaFwioid4sNE2m+1MmTEKHoAbrkxIuQO3CM5rhdD1 I/HRYbQNpisrempK/yISGDWXVzxypGSshKmbXw98Hv/d4DeohCAi9HLwK50hsgD7G+ YLKFDroD9T46g== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: 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 , Aleksandr Nogikh , Pablo Neira Ayuso , Dexuan Cui , Jakub Sitnicki , Marco Elver , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org, Alexander Lobakin Reply-To: Alexander Lobakin Subject: [PATCH net-next 3/3] net: page_pool: simplify page recycling condition tests Message-ID: <20210125164612.243838-4-alobakin@pm.me> In-Reply-To: <20210125164612.243838-1-alobakin@pm.me> References: <20210125164612.243838-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 --- 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