Received: by 2002:a05:7412:a9a3:b0:f9:93eb:408e with SMTP id o35csp81038rdh; Thu, 21 Dec 2023 00:00:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtiMQEbYUtd2QvPWckPnh/ymogaJUOOiY1JjkhKi94HE8asyVEtWW+tlnlydk90qP5EFM5 X-Received: by 2002:a17:90b:1651:b0:28b:62b5:4b1 with SMTP id il17-20020a17090b165100b0028b62b504b1mr5235091pjb.90.1703145651624; Thu, 21 Dec 2023 00:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703145651; cv=none; d=google.com; s=arc-20160816; b=mThpccAJTD319IJveNNX0AzJp6PwM/lO5ag/KxU5ixCYpmhumn4wNcpskuAPb+tyll ziroCNh/VYhjnQxqSmzkGErpQvOZCaUej58LbUI/nJNr/sbjAUBryEu1LtL87o80/8qh kZ1HTx+1Yr5XMGD1Z4zY26+OutCNZU7oPjzReiIAoX2Lj3eQEqUNUdfgjXPhdlnQKVte 8C49tWuIjFMr4EO6O48iXS1D2EON/5lUASzsaxliydc5yOgSdFHv+cF39HWnKpZD/Tz7 SI6nSk4y6frXGN3e1QovBkYOaSpUzhcW+h6+5T5x1bRkfIg4MXeHNl/7NjQo+tAK7qHa Jzkg== 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=1DPhQrPK8jXtUd4yQAGi34aPfqYNK5qEd1ohEa/6f48=; fh=FR3Cly1C5Vvj9B/ppcUhSwMJUR1L06U+mIuu732nWUg=; b=topXOcQiFmtOXKEnV8JtGVwSHZn5ggYcOW90D4WvR9exSL30UQl8cei45XjSWhNaJu q7or1wsCTghiVx2EwoeIIKa42tLRWmfxxsvKcuRqGc8aDzB6SjvEWgG+XOzIlLKwdnSA meFOFC4mCGctwojmPibESk1MxYbaPgbDVka+UHOm0d3pxj5oN2lgVKhLRi9E0MAmjns8 RihbEyBpo59SRJmvjBw4R4YGzhedmtPwwAj0oXFZUojMQ329GwNqcw2v3FnpjjIsvx+I mzyLYtDI9H8qXfIXNqDerGrDBe5OhDuzRk+pwc3jhrSJkU6BugtGhOo/+ZDyv1694It5 XHTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7968-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l8-20020a17090a49c800b002851c699781si1254455pjm.154.2023.12.21.00.00.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 00:00:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7968-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7968-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 18F8DB23CC9 for ; Thu, 21 Dec 2023 07:59:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8A6915AC3; Thu, 21 Dec 2023 07:59:47 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (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 30E17156C9; Thu, 21 Dec 2023 07:59:41 +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.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4SwjW71nyQz1Q78M; Thu, 21 Dec 2023 15:59:15 +0800 (CST) Received: from dggpemm500005.china.huawei.com (unknown [7.185.36.74]) by mail.maildlp.com (Postfix) with ESMTPS id 46AD6140499; Thu, 21 Dec 2023 15:59:33 +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; Thu, 21 Dec 2023 15:59:33 +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: <0dfffe91-2bd4-2151-cf71-ef29bf562767@huawei.com> Date: Thu, 21 Dec 2023 15:59:32 +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: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500005.china.huawei.com (7.185.36.74) On 2023/12/21 14:37, Ilias Apalodimas wrote: > Hi Yunsheng, > > On Thu, 21 Dec 2023 at 04:07, Yunsheng Lin wrote: >> >> On 2023/12/20 15:56, Ilias Apalodimas wrote: >>> Hi Yunsheng, >>>>>>> #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 >>> >>> This is still a bit confusing for me since the actual bias is the >>> number of fragments that you initially split the page. But I am fine >> Acctually there are two bais numbers for a page used by >> page_pool_alloc_frag(). >> the one for page->pp_ref_count, which already use the BIAS_MAX, which >> indicates the initial bais number: >> https://elixir.bootlin.com/linux/latest/source/net/core/page_pool.c#L779 >> >> Another one for pool->frag_users indicating the runtime bais number, which >> need changing when a page is split into more fragments: >> https://elixir.bootlin.com/linux/latest/source/net/core/page_pool.c#L776 >> https://elixir.bootlin.com/linux/latest/source/net/core/page_pool.c#L783 > > I know, and that's exactly what my commit message explains. Also, > that's the reason that the rename was 'frag_cnt' on v1. > Yes, I think we do not need to invert logic when the naming is frag_users or frag_cnt. But if we use 'bias' as part of the name, isn't that more reasonable to set both of the bias number to BIAS_MAX initially, and decrement the runtime bais number every time the page is split to more fragmemts? >