Received: by 2002:a05:7412:a9a3:b0:f9:93eb:408e with SMTP id o35csp51795rdh; Wed, 20 Dec 2023 22:38:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtIqMF+aDSiB3ckgPip5TfFLRB9FdYMoXMi7GwjlSJiMjhtkZqZa1BOwIWf4/23BVuFAbU X-Received: by 2002:a05:6359:5d04:b0:170:f329:74bb with SMTP id ps4-20020a0563595d0400b00170f32974bbmr644910rwb.44.1703140718956; Wed, 20 Dec 2023 22:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703140718; cv=none; d=google.com; s=arc-20160816; b=R6/RcIkjEx+153Tm8N5OW6NwBdvANma4JydpwSJ8vl3xqn2jD7kbudDg48M+PDReUN 39TIRjVdONtJo0xYcusby6vZKMUQrvsN1MIdT3TSdzaCCApa7qqg846op+QvwmZrbYRD AdQyXB0b4FY7zIGAb6iFfgjso+ImDWZVS/b78oFuIltWuIpG9azhQ3qv0RCMwLZppUBr cMG+D1eGHOjJBgGrUiHIzDqWAgWBPSWD9QkfQu5Ke0bCECKlQxk7e30TW098lm5O+ZXW hAHZz3gTKVFZqR4pF+p1WgxtSl0JLCJUYnM/cboX19i8u/caqPFYzbCbdb2zE99hNqDP oRlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=CGBzfoVWQeWg66Ydxo92nkSE2f64Queno0k21jGjqUE=; fh=xZiulu+bKXguaEns1I7J5eOx79NUGfw5B9pYJMKr3AY=; b=xuK2shifHxFqJ5QSjjAL0xKOx0drJxkOjYwYtsY1QxSd2CFLeA3BWy97nWMZ/Nkz9A 7s95mEulHAlL2F28mASHQNFZoOvXz8uS3BKu1207kjBQ/LvYq619GEwcrfbhOVs+tWVd B3jb485jcAdJmITwF28qpT5g0zTvlt0tqsG2D89vLUgWsbCdMb9L8I8eyBXzqSMpwFeo ZYuhglV3kMPyJkOVG2RuiOIYeZTJh8Mb8bfO5xjgYwE7ov/IZ9SY95X2pM3O1ZP22I2b M8iiHtWoRzApSD+x0Z6yd6mpXBv/sLp1jgHZ4aNtX/pfHkAtRnWon1050FkeKMAt4F6H XWJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eR23sT/o"; spf=pass (google.com: domain of linux-kernel+bounces-7897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n14-20020a17090ac68e00b0028bbed9e5a5si3872267pjt.96.2023.12.20.22.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 22:38:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7897-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; dkim=pass header.i=@linaro.org header.s=google header.b="eR23sT/o"; spf=pass (google.com: domain of linux-kernel+bounces-7897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 928CE28679B for ; Thu, 21 Dec 2023 06:38:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF2EDC2C6; Thu, 21 Dec 2023 06:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eR23sT/o" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9C0DB672 for ; Thu, 21 Dec 2023 06:38:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-50e587fb62fso662850e87.2 for ; Wed, 20 Dec 2023 22:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703140703; x=1703745503; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CGBzfoVWQeWg66Ydxo92nkSE2f64Queno0k21jGjqUE=; b=eR23sT/oGUIP5z7xhrTLeKCY33QVcGYs4XltPVR+x5ad0nAStFZ/Ao4ALVfiN1CnTE ftk7OSH4z540HPW1up5H+/5urXgIx+gqC0fyy56e6BnLhkj20HO1wkvclFRy/y8SAF9k AzZQfQZrDYSCYQEuP6Zo6A+juW3POJu+KoJ3uBJt2ZF4KOL4cPFg3Kb6vZk2btBzuw8D C2KiHpBi8NAXW1r2SjQGHCOhPaTannunh1HWitVGeMA9WFSNZbDNIWjxuoVd31sd+lzQ f0JBzk0izZ03h+V0u/oLclag31DKIcXsJCI0Gg3zt/lDt847cU7aErKV4wYXQ0WOIev0 6ecQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703140703; x=1703745503; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CGBzfoVWQeWg66Ydxo92nkSE2f64Queno0k21jGjqUE=; b=Ka+aPewNZtEKUWdtvHrKmVOTg8tl3mSd9a1tZBy5TKRT7P3wDMFkFVHnuciHGhzXrh nDFoSWiOVz0E9G9x5sSlNbefbyCPYF5SPxld9cjtZueA/4cUvDVoCQ7it2BvyU4+tauK GgkAG6MRVPsQ2B/qkr1i9XnAiIvKjPbPAxTK2cgLgGcjbIQXP5FpprVG3UgJkxy17/Zm nHBJ8QH8syLSlvumqZ4j5NpjOyP6ozmB4sss43GciXJben9yYBbq5ZsHr4DP/PkBvfMM sikTEESzHdt0N14Uk0f4n6jo0VCT0T7K7xmRpqWax9N9ZTL963BWXshpkN3Z6M6S2KBN sgEQ== X-Gm-Message-State: AOJu0YxnzTIeC/Z7mmST+hHyqUSRuDUkiOaAc9poYuItncdSqNioHSWO vsCAAj8HOCO2ddI2JDCTIjSwjudXYWG2FsuTFGvAmg== X-Received: by 2002:a05:6512:1113:b0:50e:51fa:1d3b with SMTP id l19-20020a056512111300b0050e51fa1d3bmr1203596lfg.93.1703140702673; Wed, 20 Dec 2023 22:38:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231215073119.543560-1-ilias.apalodimas@linaro.org> <6fddeb22-0906-e04c-3a84-7836bef9ffa2@huawei.com> In-Reply-To: From: Ilias Apalodimas Date: Thu, 21 Dec 2023 08:37:46 +0200 Message-ID: Subject: Re: [PATCH net-next] page_pool: Rename frag_users to frag_cnt To: Yunsheng Lin Cc: netdev@vger.kernel.org, Jesper Dangaard Brouer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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. /Ilias > > > 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 > > . > >