Received: by 2002:a05:7412:a9a8:b0:f9:92ae:e617 with SMTP id o40csp108987rdh; Wed, 20 Dec 2023 18:07:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IERaJgBzKJMTNxnsrSDvUhmDB+/wtc1I9B5vLD+B2SGkRhk1xmB9oIirOFDzeoR1B/mGT3V X-Received: by 2002:a05:6512:128c:b0:50e:4e89:7de1 with SMTP id u12-20020a056512128c00b0050e4e897de1mr1482481lfs.97.1703124468975; Wed, 20 Dec 2023 18:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703124468; cv=none; d=google.com; s=arc-20160816; b=tiTz2ArirmgVF/HmpUr/ijfwqoiBP48K0Upi2WTPEUfHe6PCUo/in0c0va2/xqj/4/ HdUAtIo1xQfJrDlFT0iOXzkbN7BGyJn+oAeoJql410hepsbiD10GV4cm4mMbzYFGRYGx 6T67lFq8ofF4PeuDpgqOV0wQReZRigvnit/bkP8u95tN9Mc4DrzJPosJQPhyf4k4dmlK aRSwbq1Gk0RvpgeMG9ibBLRYB/GGhfyBICwb4nmSDoNaBqb8Te2L0t6nj645kyxXBIZe DsGZMtgXhM4H4bOKOYQkU9GScPhfgUkpm2lpwSUKGMPYtMZgJYF9/tIdDMMmTf2UKLdD IAGg== 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=/c3An9cwKWGL9kp6q2NhJotCR5ywQm/ebVTeDlaSU3c=; fh=FR3Cly1C5Vvj9B/ppcUhSwMJUR1L06U+mIuu732nWUg=; b=pW5SCFxKWxa+By1nhGIZ/DrhWoUDKPCsI5eDMQ0l54vZjVyk8lLS1cqXN2AOy2pw63 fIcaED0DxQD/jSkeqcqN40Ajb24N8sS6ymyqAVVy8Sgy6tADl3R4XnWRZ1L71pFwe/vC h7PPY4y+yjR3qnIMZ25qnuWC4ogNqSILoGs+g5VXicy9kXEJmht8HSt/xXiv4sr0seTq ufjIxDxSYncs8BffYOJVO4wsxh20l5eYgz5fdWZTFOHYQmrcMBU9xBKWocm/r+J+62SA 0zb0akesknVEtkTtgNcoiZn8PSRl2OspH00vXqlDSMdj0XCpFQ0rl5IADXNZ/G5Yg9ru 48uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s17-20020a508d11000000b00553bfa1dee0si378917eds.64.2023.12.20.18.07.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 18:07:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-7743-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7743-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6ED741F24A5C for ; Thu, 21 Dec 2023 02:07:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 599101FCF; Thu, 21 Dec 2023 02:07:39 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 58E164416; Thu, 21 Dec 2023 02:07:36 +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.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4SwYgm6mTtz1fyN7; Thu, 21 Dec 2023 10:06:12 +0800 (CST) Received: from dggpemm500005.china.huawei.com (unknown [7.185.36.74]) by mail.maildlp.com (Postfix) with ESMTPS id E4DA31400D5; Thu, 21 Dec 2023 10:07:26 +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 10:07:26 +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: Thu, 21 Dec 2023 10:07:26 +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/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 > with having a common approach. I'll send the rename again shortly, and > I can send the logic invert a bit later (or feel free to send it, > since it was your idea). > > Thanks > /Ilias > . >