Article View: linux.kernel.netdev
Article #2339Re: [RFC PATCH 0/1] mm: page_frag: account page_frag pages in vmstat and meminfo
From: "David Hildenbrand (Arm)"
Date: Mon, 12 Oct 2026 13:34
Date: Mon, 12 Oct 2026 13:34
74 lines
11547 bytes
11547 bytes
On 10/12/26 13:27, Pedro Falcato wrote:
> On Mon, Oct 12, 2026 at 12:36:35PM +0200, David Hildenbrand (Arm) wrote:
>> On 10/10/26 04:59, Yifan Li wrote:
>>> This is an RFC.
>>>
>>> Pages held by the page_frag cache are not accounted by any memory
>>> statistics counter, so on systems that derive "LostRAM" as MemTotal
>>> minus the sum of accounted memory they inflate LostRAM and lead to
>>
>> Sorry, what exactly is subtracted from MemTotal?
>>
>> How would any other kernel allocations be treated?
>
> I suppose those would mostly show up as Slab:. But yes, I agree the metric
> is a little dubious.
>
>>
>>> misleading "leak" conclusions, even though the memory is legitimately
>>> used by the network path.
>>
>> Assuming "leak" in such scenarios is questionable, sorry.
>>
>> Aren't most page_frag allocations short-lived? Or is this more about the
>> page_frag cache?
>
> page_frag allocations are kinda arbitrarily lived. If you queue (send) some
> data to a socket to send over the wire, they are more likely than not
> short-lived, unless the protocol/qdisc says no (for example, you're hitting
> the TCP congestion window and as such can't send more data over the wire).
> If you send it over loopback/veth you get arbitrarily livetimes as sockets
> can keep the page frag alive if the application never reads them.
>
> On the regular RX side you can also (AIUI) keep page frags randomly pinned
> as long as you don't read them.
>
> (note that all of these allocations are bounded by each protocol's memory
> limits)
>
>
> In any case, I remember an off-list discussion with mhocko regarding a
> downstream bug, where I suggested adding a counter for this, and he said
> networking is somewhat sensitive to extra accounting on the fast paths.
> Added netdev in case they have comments.
That makes sense.
>> Certainly no page flag.
>>
>> A page type might be the right choice. I don't think Willy planned for that [1],
>> IIUC, the bump allocator was something different, but another page type
>> shouldn't hurt at this point.
>
> A page type might not work, these pages _may_ need to be mappable. I know
> that was an issue for page_pool (Yet Another Networking Page Allocator) + TCP
> zero-copy RX using mmap.
I'll have to trust on networking experts, I was reading:
(requires that page_frag pages are never
mapped into userspace; true for the current RX paths).
>
> Of course, if you have a page frag under PAGE_SIZE or misaligned then you can't map that.
It would be best if we could disallow that entirely :)
(of if required, map them through a PFNMAP or similar that does not care about
page metadata ... but the interactions with GUP are tricky)
--
Cheers,
David
Technical Details
Message-ID:
<01349eb9-8833-4cf4-bb42-b1d5a608c83d@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344999-linux-kernel-netdev=dewy.ruReferences:
<20261010025941.1253-1-liyifan21@xiaomi.com> <40fc5d04-2a20-42c4-9557-7277bc981172@kernel.org> <asy9PzW41-Wi0JXC@pedro-suse.tail5790ac.ts.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344999-linux-kernel-netdev=dewy.ru
From: david@kernel.org ("David Hildenbrand (Arm)")
Newsgroups: linux.kernel.netdev
Subject: Re: [RFC PATCH 0/1] mm: page_frag: account page_frag pages in vmstat
and meminfo
Date: Mon, 12 Oct 2026 15:34:32 +0200
Organization: Usenet Network
Message-ID: <01349eb9-8833-4cf4-bb42-b1d5a608c83d@kernel.org>
References: <20261010025941.1253-1-liyifan21@xiaomi.com>
<40fc5d04-2a20-42c4-9557-7277bc981172@kernel.org>
<asy9PzW41-Wi0JXC@pedro-suse.tail5790ac.ts.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
logging-data="1789069"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:tbn72G39uj4Oo8bUyU20SiJ7Ubc= sha256:rmHfW0OZ9x3jz9GWxydMZMBWrLyun/EB6n19RoVfwvs=
sha1:tsKLVbeK3YiAXWKizWKtge4lLTg= sha256:zNVo2mw4ilfLN/LoipggoEcxSmB0FOhlQhl618LjE18=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 798FC10FBF0; Mon, 12 Oct 2026 16:53:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.341
X-Spam-Status: No, score=-1.341 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id Ig7LOXMdqsBV;
Mon, 12 Oct 2026 16:52:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-344999-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 998B610FBD7; Mon, 12 Oct 2026 16:52:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 2C1CFC11D4; Mon, 12 Oct 2026 13:35:53 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D2B07376A09;
Mon, 12 Oct 2026 13:34:37 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Pb2qwS6e"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
(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 B7483376A1E;
Mon, 12 Oct 2026 13:34:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791812077; cv=none; b=gAjsu8RTa/eaXYHoPLl6rjNjM/sDqaRVPk84ZCqZCw1zptDBIv3AiFoWHVWMGimKKdFtP69fV2YoFaej8sYYv/DxOFVLDH8EG8fj3JrWKGIruO6u6saIxY42coNqirIDonA1ciYs+4VHshQIZV1y/H9ezMBlou9y51naFNDBRhg=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791812077; c=relaxed/simple;
bh=fJGw0cpjBTi5/7bzqDmqo6fj6jl7Cb/zKCJc7n6Iuf4=;
h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:
In-Reply-To:Content-Type; b=FB/LnBMNcW4qvKzBd1rVemcPyHoFqQILhsyqNk0TfiJP9c9gsVKMQOe9n72MhF6wf/yporMeccKuoKqu1diJpWDzRBwN7GRQyuXXIHxZVfdv/2N+cSkSTGSMX23RVrVzGxgSNvI8Qg563nN4orb7dHHpXeALLeK9re3pHtUhHlU=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Pb2qwS6e; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D2831F0089C;
Mon, 12 Oct 2026 13:34:33 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1791812076;
bh=BJoKG/6UOVhJtQlfQRanKoyfmf6h8PW7vA7hrTi9Uzs=;
h=Date:Subject:To:Cc:References:From:In-Reply-To;
b=Pb2qwS6eWHO6MPz6e6Cjv4IRYSsPioj8ppCtOqUDgtF5oADW4amg4Rm2d7JZotQw+
GFRMFOZog5JGPM/vi3cITAw2xXHYkWcOPUPNdygjRLcToiGgwezrK2esxqasNlm41c
1la4YDWxCXqPasGkTAzsjlnXTL7QG0XFmaUTZCWQM5YHTijpXSoU7Muk8T1pOm9B7l
ZZHzIWI0J0W7qyl17QBn7c43TRFfYVV3Wlb3cuiMiz0WsECUXjk40joq6b92W/zoFC
2Ha28M5aDVhTHoRDPbawlXzi8d0o6txkkqde30XTk7KbDZoIMKa3RK1ttNOfJtAfJL
esL/Yl33fruSQ==
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-User-Agent: Mozilla Thunderbird
X-Cc: Yifan Li <liyifan21@xiaomi.com>, akpm@linux-foundation.org,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, Matthew Wilcox <willy@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>, mhocko@suse.com, netdev@vger.kernel.org
X-Autocrypt: addr=david@kernel.org; keydata=
xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ
dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL
QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0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