Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3762800pxb; Tue, 26 Jan 2021 04:15:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJydNYOczh2bWL0CY3Ye/7y9swp+j7b17IspjsvkYw92j6DPFejB1dxvRYGmwCJAu9PsxXcS X-Received: by 2002:a50:bacb:: with SMTP id x69mr4317330ede.39.1611663308381; Tue, 26 Jan 2021 04:15:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663308; cv=none; d=google.com; s=arc-20160816; b=NdYOKQJUiPQx7wB2RrZ5cc/4IL4Jt+35BjvLQCSP1hUeCq/7nBRP72hqgpw67groS0 MWYPQJjL2RzqWZUvSSMHVkWBDBAHadaa+g4Li5q8ibzj8vc9GGDSPtFZDcbmKdB6xzm/ Cmj96styQBYyci1rbP/RBF8ujhR4jlg2dOzz9bMcYF5JzOYb7j3dPZnzi08Hi1dVOfj2 lT0Bj0mV8rp3XH3uwsMajOOHaR2d39iDHzggGLaaLOuQWrvOIq2QEYz44nhGviJPSgI+ opIIN5esV4VCZNIl0hc7j5WX7thtlD1T181nXgQgGHQrXqe+8O31o1HusuVXbEo+ZaK1 H5vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YexESypTZUXGxM0RNYUq5KscUb8ruQBrW1cIhg1mZJ0=; b=Eh829HzJ+ZTRyj6o0g3fah5X5Wa9Htrt4g/EpXlaYWOs7PAimtaXoOChsymv7Umwf7 HzoMSAb1vpsrFZCwtEZQltSDQa4WiQDFezhHphwIuNUcb2NnVWxH/rphJIPYumND5dYz 1MZkxTChwkb3SwI0vRpVTmmUcxZy2/Y+A3F70B1X4zrXBl3jmZcemhAw3PBSz7U7y9eN O7jX8SpPhmosvpyW7U7iC82qPiMmYwwItT4B3Py5RDMFhdm8uO/3zqn/n7mwkABDgXrG 9mJoQ3Bj1KAJVt4FahSkiIH5JFLjer36Wev5S7jhjD6+VzV3gVOdMDkImvujR4h38k7u udRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bskZDSuM; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c26si7003976ejm.600.2021.01.26.04.14.43; Tue, 26 Jan 2021 04:15:08 -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=@linaro.org header.s=google header.b=bskZDSuM; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405011AbhAZMNN (ORCPT + 99 others); Tue, 26 Jan 2021 07:13:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404947AbhAZLJU (ORCPT ); Tue, 26 Jan 2021 06:09:20 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D50E3C061756 for ; Tue, 26 Jan 2021 03:08:33 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id h9so5744946wrr.9 for ; Tue, 26 Jan 2021 03:08:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YexESypTZUXGxM0RNYUq5KscUb8ruQBrW1cIhg1mZJ0=; b=bskZDSuMdTWcqASyQOy7OtS5KG6+pzOlrEOQmnZLWuKDog92AwWAC1iTsT88zhd+Ja ZTzLqQWfD+pNGaDtTg9/JwZGrg2jqNk3p00j0Vqeou4Es5qRMXi3/B5C/X8WDGdgvLC8 Mj3oB0BD2rnEjNWyqV+6YxFkgxDX0gk7IrTBWoutXmKk+hMV/QjsiqUyNqRK8Iswsc7m L/hxU2h/VFLAZ4DsQP4cuQ7HTUZC0vC1x1KXSwSA/5/55OU/Ep4640dCRmO3bKDGb5Zn HmIQWYUROmzmI+3qbDfiEH9LsEymELXtGaIE2e6Wv5p2XA69vrlDal64gt7vPdqeUPwV TT1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YexESypTZUXGxM0RNYUq5KscUb8ruQBrW1cIhg1mZJ0=; b=JDrfC4sl4hUX/hrZIDgfip9QS6pTDuZfpS/c0+lqBBa6UgNvIEze7dik/XZRtkLAJC BaHHAVaSDy1HesBfydtoNUEpldncnU9WBt/F6+GteRzT524S3QEwK81qZGO9NvzDeGJp kxDt2AZAsNpH7NYbIGt5DATAShjBlMG1NY04hG/NXwf6nTYb1VKBPFgDYyTPRywxOkbv lfkWQUheMMJCqomg5LgNPd83b7RXoFxlDsDLv1Fvk21qg0DNlPDWyaXttbT1MjAdu1e/ 5ANHBB3k6cA66XvjquAOhIrFJGvPnJzX02b3952rIyb/qVFdqueTgD/WKhTVo2bCf5nx l2/Q== X-Gm-Message-State: AOAM532ae7nsNMIuA8lK9a50Op81qV1oM36OVDohji5odmTEFv/zmIbp WmGw2EpbYPse/btA6ntcmD7zxg== X-Received: by 2002:a5d:440a:: with SMTP id z10mr5556407wrq.266.1611659312476; Tue, 26 Jan 2021 03:08:32 -0800 (PST) Received: from apalos.home (athedsl-376992.home.otenet.gr. [79.131.24.158]) by smtp.gmail.com with ESMTPSA id z18sm10610031wro.91.2021.01.26.03.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 03:08:31 -0800 (PST) Date: Tue, 26 Jan 2021 13:08:28 +0200 From: Ilias Apalodimas To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Saeed Mahameed , Leon Romanovsky , Andrew Morton , Jesper Dangaard Brouer , 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 Subject: Re: [PATCH net-next 3/3] net: page_pool: simplify page recycling condition tests Message-ID: References: <20210125164612.243838-1-alobakin@pm.me> <20210125164612.243838-4-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210125164612.243838-4-alobakin@pm.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 25, 2021 at 04:47:20PM +0000, Alexander Lobakin wrote: > 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 *page, > return true; > } > > -/* 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) > -{ > - return !page_is_pfmemalloc(page); > -} > - > /* If the page refcnt == 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 page *page, > * regular page allocator APIs. > * > * refcnt == 1 means page_pool owns page, and can recycle it. > + * > + * page is NOT reusable when allocated when system is under > + * some pressure. (page_is_pfmemalloc) > */ > - if (likely(page_ref_count(page) == 1 && > - pool_page_reusable(pool, page))) { > + if (likely(page_ref_count(page) == 1 && !page_is_pfmemalloc(page))) { > /* Read barrier done in page_ref_count / READ_ONCE */ > > if (pool->p.flags & PP_FLAG_DMA_SYNC_DEV) > -- > 2.30.0 > > Reviewed-by: Ilias Apalodimas