Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6502463rdb; Thu, 14 Dec 2023 23:31:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEF2bacNqQhr1Rq2be87YgohqoweMFq1tLjyEbpNkqjcDmwaTYv2A36gLsddKMJ7yx3V2D7 X-Received: by 2002:a05:6a20:8410:b0:190:22f3:caa3 with SMTP id c16-20020a056a20841000b0019022f3caa3mr14005414pzd.29.1702625516685; Thu, 14 Dec 2023 23:31:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702625516; cv=none; d=google.com; s=arc-20160816; b=wlTHqwDWHgfdcM96CH8WuWP5VLKPWaqXzqrc3FtL6uiqAb86bAdh3mx/aLD1ptS/4G /Vp8D7EYv7bXNblQ6qCydTMr5sp0zH5u2SFZ1hMPCH9c9awkxXaYNz0ha+CW8cpgfYoC LWYV7LNnE2xd0jvsvoTqo1pq4SHDSNoc349jjq09NCfNJsTr/3PbDUNgIq1vXIkfhm9u vS3Y6/ItpGguv1mmlvLAF59yhVAz6I91Me1y2Dj4qnRrqzPvfviYeNTrzkHtULqNKDBp EPrfHILD8jpwhDv8N9nE/hXvMzJUWUMZFbZ/Pp7aeAzan0rXungfx4+xts83/i3mJKGd crEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=y3LpvrqPMHTpFgWHeM6VHdWnvBHwIABqDsat0ivEWK0=; fh=Ep9OtI3hwH+mjkSKerJ++vABqu0V3puokxRkxJA5gW8=; b=S31c1nZBDuWsbQuMIBwcr0hsypGUbWZzLJktUBIevXbN6bbzdspgXjfn1phrCQ/za1 p7HSraGG8U1OUsibgJdXPyU2HHsfImJ+IyxNN8z+3TycvDYBtMnHJ1/mKYPqo+ZarIIS 06xYIyBWNM96GSQwlB2HkiUc6Cq8SXrXkecCFivl2V1QL/M47pzibwwuBu2H2/58JZ4K L3jeBuq9L2rF3mr7Muuh2+UwIsY614HUpaSnXKTO8t4euARHgM0OW3r+t4fMC3fHwpeg HrhGeVUq8/7j/Tk0PynL/i5OCPqJt4LcMj4xg0/87cAOhEfShYxBc3XqY7jggY7UDX8C RBEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oK+WEWb7; spf=pass (google.com: domain of linux-kernel+bounces-520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-520-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e21-20020a17090a9a9500b002867a1cb538si12539756pjp.10.2023.12.14.23.31.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 23:31:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-520-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; dkim=pass header.i=@linaro.org header.s=google header.b=oK+WEWb7; spf=pass (google.com: domain of linux-kernel+bounces-520-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-520-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B8FA7B20FB6 for ; Fri, 15 Dec 2023 07:31:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1498AD523; Fri, 15 Dec 2023 07:31:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="oK+WEWb7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.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 BCCADD2F0 for ; Fri, 15 Dec 2023 07:31:41 +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-ej1-f50.google.com with SMTP id a640c23a62f3a-a1d2f89ddabso40383466b.1 for ; Thu, 14 Dec 2023 23:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702625500; x=1703230300; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=y3LpvrqPMHTpFgWHeM6VHdWnvBHwIABqDsat0ivEWK0=; b=oK+WEWb7yYhqHH8CkLL+1rpsbBvE7Yb3cM6grtxi48LC4dU+4d3vkV7lPITOdxLW1O bWqNbvd2+PwtJh11J49SeLZpApDLR55cY0ylzey7fWFrWBmKLyvNu10OtxVqEYsH7VvO XudGHcALJ5OmSKcZdW0m/ndVQRzU3n+HnjBxVMJExnpVVW3znzKv76iBPd9UyTtQUonr 9BGRyTGD2LozK1/keBUvFwiIjOMt8VHkY52+jGfTVufJXoxhjiXxwUXzyqgC42gC9tvy LzghMz4wvuMaaMZBOPm5WGnvmUcUcvBGCVv48TZhpFOO4iOJlHMKtdqo8cnS9JKfhTTS bXDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702625500; x=1703230300; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=y3LpvrqPMHTpFgWHeM6VHdWnvBHwIABqDsat0ivEWK0=; b=DPVZmIQaTSEpY9kVPoaGrSk69yaZQ3aTO7cOfhij0zxkf7OLkD1S8pxZUUOuvhSoFg A1ScfHnQQXgbG/AjFhmSd9OmuTrWVmpfWvrP+IE42Cn2oZbzJNEymrtxLldwUC4etrno 3ln56F4R4GGGB+LRQdvcfFlxQK5BvAYd+4KYmQw3Qr5PnukcmWCsAVgr4vos83FRvZGr Z0ziV6fgFazMyYEEVXORRBdrx54r+YHzajQaaYHmpdga7laCg7rxsfI28BAs30bX1YGi Y0vt4Mz399UN13i2lZv57ZJQLDEI2N/+4Vd+hSetxciw1AIXMIEGjV0MD+D4GVQZJhQQ VM1w== X-Gm-Message-State: AOJu0YxhPigklyDQ3XwoG03xsQ/k3g76dSPjt/hLRphvpjjA5QW81sXP MyKOLz/lklt+fshJF4gYEGt2hQ== X-Received: by 2002:a17:907:7677:b0:a09:589f:8853 with SMTP id kk23-20020a170907767700b00a09589f8853mr5786522ejc.66.1702625499973; Thu, 14 Dec 2023 23:31:39 -0800 (PST) Received: from hades.. (ppp089210121239.access.hol.gr. [89.210.121.239]) by smtp.gmail.com with ESMTPSA id vc11-20020a170907d08b00b00a1ce58e9fc7sm10372337ejc.64.2023.12.14.23.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 23:31:39 -0800 (PST) From: Ilias Apalodimas To: netdev@vger.kernel.org Cc: linyunsheng@huawei.com, Ilias Apalodimas , Jesper Dangaard Brouer , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH net-next] page_pool: Rename frag_users to frag_cnt Date: Fri, 15 Dec 2023 09:31:19 +0200 Message-Id: <20231215073119.543560-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.37.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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; #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; /* Some user is still using the page frag */ if (likely(page_pool_defrag_page(page, drain_count))) @@ -678,7 +678,7 @@ static struct page *page_pool_drain_frag(struct page_pool *pool, static void page_pool_free_frag(struct page_pool *pool) { - long drain_count = BIAS_MAX - pool->frag_users; + long drain_count = BIAS_MAX - pool->frag_cnt; struct page *page = pool->frag_page; pool->frag_page = NULL; @@ -721,14 +721,14 @@ struct page *page_pool_alloc_frag(struct page_pool *pool, pool->frag_page = page; frag_reset: - pool->frag_users = 1; + pool->frag_cnt = 1; *offset = 0; pool->frag_offset = size; page_pool_fragment_page(page, BIAS_MAX); return page; } - pool->frag_users++; + pool->frag_cnt++; pool->frag_offset = *offset + size; alloc_stat_inc(pool, fast); return page; -- 2.37.2