Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6647804rdb; Fri, 15 Dec 2023 04:52:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTeoGdorLMFKU/NNmGGLpz8WYaEi/n/aT/mA35qg+4qCBc8YA+NU3dhmwctRn9+4JF9VUJ X-Received: by 2002:a17:902:6f16:b0:1d3:66ba:454d with SMTP id w22-20020a1709026f1600b001d366ba454dmr2781557plk.4.1702644770888; Fri, 15 Dec 2023 04:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702644770; cv=none; d=google.com; s=arc-20160816; b=0hlEySi/ofHtHzeta1WxRlYyD/m08srPfhRaGg8cTmwqXYwi8Exr65ddSbcQHRW0Ki AMyY3D4QissTm8Eoye7xPym84w+lZ/WbcNv/L/q5yBkrxevqN32gPmUrKKlcXT6G8kTm RaGFPxx2AJ3b2kXJDeZVoQQ5srWczq+On196rfd6Qu47gE8QGEVIr0/8FugMRIiaLXL5 E/ebgcuGQQJmFypXtIq5nBoXnjp42rPxq934RTmRSKgyLk735U677WFstHiJWaXd+33X 6llkqHtY6BUlmsBeVGjsQQxCa2QGceGac06M1ypTGfeROJuS+L20xbtWD0/+tyCwB43J 03yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=Q5xzDu8ibqmEr19Oh6gnz/dJB6Sq0h1bk9EEUUZMNuA=; fh=FR3Cly1C5Vvj9B/ppcUhSwMJUR1L06U+mIuu732nWUg=; b=zK6YDVj88T6/kQdLA8/f8G+diEf3tY3zpx2ARkuMOHJsrad+HeUWFJdCeVUbDumTuF wTP7VY/qUOD2KxgL9FhCS0pDgLY7iHgiGO9Ll0yxsFj/hbSC9YBt6TbQtqW8JR2aY8LD PszDIAnHaHKjKz035jJ2lUNhX+4RhpXCi2CPA8KqIoAzNbnG5iapT2L7O6EldxdxeuDJ LxMYHGzaaLHtFK71zgr+Yub24UU72eAHhmij8q9QoEuSq+BXdly89LXi38vGBkUu2FrQ 8IDwnSWF9thS5oWA6RkJufdc6TUuBqg3ecReIbFUgBMCweN4ESrmExc3BRBY/0BUVU0L eJJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v17-20020a1709028d9100b001cfd24c7b81si12946291plo.216.2023.12.15.04.52.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 04:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-955-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8A493285E7F for ; Fri, 15 Dec 2023 12:52:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F02912D7BB; Fri, 15 Dec 2023 12:52:22 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7952D2F842; Fri, 15 Dec 2023 12:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Ss7tx5HrKz2mGxD; Fri, 15 Dec 2023 20:34:01 +0800 (CST) Received: from dggpemm500005.china.huawei.com (unknown [7.185.36.74]) by mail.maildlp.com (Postfix) with ESMTPS id 944321A0190; Fri, 15 Dec 2023 20:34:06 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 15 Dec 2023 20:34:06 +0800 Subject: Re: [PATCH net-next] page_pool: Rename frag_users to frag_cnt To: Ilias Apalodimas CC: , Jesper Dangaard Brouer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , References: <20231215073119.543560-1-ilias.apalodimas@linaro.org> <6fddeb22-0906-e04c-3a84-7836bef9ffa2@huawei.com> From: Yunsheng Lin Message-ID: Date: Fri, 15 Dec 2023 20:34:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500005.china.huawei.com (7.185.36.74) On 2023/12/15 19:58, Ilias Apalodimas wrote: > Hi Yunsheng, > > On Fri, 15 Dec 2023 at 13:10, Yunsheng Lin wrote: >> >> On 2023/12/15 15:31, Ilias Apalodimas wrote: >>> Since [0] got merged, it's clear that 'pp_ref_count' is used to track >>> the number of users for each page. On struct_page though we have >>> a member called 'frag_users'. Despite of what the name suggests this is >>> not the number of users. It instead represents the number of fragments of >>> the current page. When we have a single page this is set to one. When we >>> split the page this is set to the actual number of frags and later used >>> in page_pool_drain_frag() to infer the real number of users. >>> >>> So let's rename it to something that matches the description above >>> >>> [0] >>> Link: https://lore.kernel.org/netdev/20231212044614.42733-2-liangchen.linux@gmail.com/ >>> Signed-off-by: Ilias Apalodimas >>> --- >>> include/net/page_pool.h | 2 +- >>> net/core/page_pool.c | 8 ++++---- >>> 2 files changed, 5 insertions(+), 5 deletions(-) >>> >>> diff --git a/include/net/page_pool.h b/include/net/page_pool.h >>> index 813c93499f20..957cd84bb3f4 100644 >>> --- a/include/net/page_pool.h >>> +++ b/include/net/page_pool.h >>> @@ -158,7 +158,7 @@ struct page_pool { >>> u32 pages_state_hold_cnt; >>> unsigned int frag_offset; >>> struct page *frag_page; >>> - long frag_users; >>> + long frag_cnt; >> >> I would rename it to something like refcnt_bais to mirror the pagecnt_bias >> in struct page_frag_cache. > > Sure > >> >>> >>> #ifdef CONFIG_PAGE_POOL_STATS >>> /* these stats are incremented while in softirq context */ >>> diff --git a/net/core/page_pool.c b/net/core/page_pool.c >>> index 9b203d8660e4..19a56a52ac8f 100644 >>> --- a/net/core/page_pool.c >>> +++ b/net/core/page_pool.c >>> @@ -659,7 +659,7 @@ EXPORT_SYMBOL(page_pool_put_page_bulk); >>> static struct page *page_pool_drain_frag(struct page_pool *pool, >>> struct page *page) >>> { >>> - long drain_count = BIAS_MAX - pool->frag_users; >>> + long drain_count = BIAS_MAX - pool->frag_cnt; >> >> drain_count = pool->refcnt_bais; > > I think this is a typo right? This still remains It would be better to invert logic too, as it is mirroring: https://elixir.bootlin.com/linux/v6.7-rc5/source/mm/page_alloc.c#L4745