Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3330058pxb; Mon, 25 Jan 2021 13:00:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv4mj1byYIysVREtU8q4OcVimhd1V0sRxE/GA8E4NuVLbwoUrmSBdBWNGZjo4weKpOWBm4 X-Received: by 2002:a05:6402:757:: with SMTP id p23mr2061879edy.245.1611608401636; Mon, 25 Jan 2021 13:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611608401; cv=none; d=google.com; s=arc-20160816; b=K4GYKR6B/rc8ZWbbdOn+ErQyLY3t8c/B3aRSOYQqfJ5m2U3JlD/4C8hzpPFKdLKEy6 tFTLSkJNo2OxDHYwD/GrF5V6+/dGFgvXpQP9nGK1zOGqFGuUsaiPCvd63Qmr6bj9XF4A 3BhKBbfUIwRn+MOPFJLzdr71zXNDAdaXsHZYL/dIp8GcZN4PzupkaHayK5+uKKqn02eA h18Wuj4WMNonG/sN7tDlXBJdGXkbstFscKtrFFqaLiV/U9b/bs0y99OSfhEKBJOx3vuk wTT6gSJ8fHLrat6JzAhkIre0BRoRawkxEtO7fcWjBj1bKh/stkJp0bT+ViECTqvz68mo ipYA== 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:cc:to:from:date :dkim-signature; bh=sLaxbldCpmtlUDFodMqs6EtRoH2fJw9kHTicx3mvJQs=; b=ZhtkQLww51f5a6gx0MLNbpnBgkWH2xX+O5kEwbXoMf8oaRloBJ0MJ8Ft+t7qjYIdR1 AxeqqtGyn6gMObxVLsGkq8fSHAoi8bdmTJtK6CW5KpuoSprJh9Jf/eQnM1SnF0Krpf35 Lg2mIAfJgPvRg4Rg0b2EKnguF2imYCf/Kul7pkQ+c0l+CecculOVm8qFYZawmQIUCkIo pnctLsi/rstVlBKQERMpcQdY5IlOIA6m+qhugW5IhSMJAoX5tCXt4P1/ldAFyKsJruF9 hOZv/eRs2gq7x+ivuCZoHW2Cuy4g6c0ukLjkMCbVBN58FvEM42ke8O/GORFZhPATRlGC UMpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hvPyM2X0; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si6277272ejk.379.2021.01.25.12.59.37; Mon, 25 Jan 2021 13:00:01 -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=@redhat.com header.s=mimecast20190719 header.b=hvPyM2X0; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732113AbhAYTql (ORCPT + 99 others); Mon, 25 Jan 2021 14:46:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28732 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731495AbhAYTYT (ORCPT ); Mon, 25 Jan 2021 14:24:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611602559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sLaxbldCpmtlUDFodMqs6EtRoH2fJw9kHTicx3mvJQs=; b=hvPyM2X0t8/a1Hl1GHJUJLTZnwM2EAdqO/HQuzPvzyIHHGLuYA1hndLkJWsPQo2SlLMmlx rBSv1bD2J9G58sOhE8Qc4GaQ3RthaZOgz8ExP4ct5PUXHbFNIiwrrzgFcNNNnVjRqdEGvD cM+3mRzbbfYxJEF8RaPDVA8+wiI5oM0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-561-wbF-Bqt3NsKIoD6ejRlndQ-1; Mon, 25 Jan 2021 14:22:34 -0500 X-MC-Unique: wbF-Bqt3NsKIoD6ejRlndQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E23E9100C601; Mon, 25 Jan 2021 19:22:30 +0000 (UTC) Received: from carbon (unknown [10.36.110.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 251C960C0F; Mon, 25 Jan 2021 19:22:21 +0000 (UTC) Date: Mon, 25 Jan 2021 20:22:19 +0100 From: Jesper Dangaard Brouer To: Alexander Lobakin Cc: brouer@redhat.com, "David S. Miller" , Jakub Kicinski , 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 Subject: Re: [PATCH net-next 3/3] net: page_pool: simplify page recycling condition tests Message-ID: <20210125202219.43d3d0f0@carbon> In-Reply-To: <20210125164612.243838-4-alobakin@pm.me> 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-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jan 2021 16:47:20 +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(-) Acked-by: Jesper Dangaard Brouer > > 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) -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer