From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B439BC369B1 for ; Wed, 16 Apr 2025 05:25:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4613628010D; Wed, 16 Apr 2025 01:25:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 414A5280107; Wed, 16 Apr 2025 01:25:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B25428010D; Wed, 16 Apr 2025 01:25:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 08274280107 for ; Wed, 16 Apr 2025 01:25:00 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 230DDC1F06 for ; Wed, 16 Apr 2025 05:25:00 +0000 (UTC) X-FDA: 83338767960.02.92DCD19 Received: from invmail4.hynix.com (exvmail4.hynix.com [166.125.252.92]) by imf17.hostedemail.com (Postfix) with ESMTP id 7712140004 for ; Wed, 16 Apr 2025 05:24:57 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1744781098; a=rsa-sha256; cv=none; b=supKdJwO0FgRU7fxY0TvhlpF2ij2b9MUHiigxcn/3q1dE/J67m9MnY7RORPVgHtnR9SnsF FoJ7liKH5R/VIA+43O88yAmebryn4c42Qg6+nOIFzTM+U4hX8h6JrVPcbtTSPoeZYUjBXJ rAOwkBBF5ns7KM7//xS1cB1lITfyeKw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf17.hostedemail.com: domain of byungchul@sk.com designates 166.125.252.92 as permitted sender) smtp.mailfrom=byungchul@sk.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1744781098; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/0VjyQx5QX6MDbvfZBFjyl3xhbtANwxFZxUqs4tLwbg=; b=fNeAP4jftj35lbX1NwGJj6lM5WcGx/hnKzbdRqizOXUsNtSX32puU9RZwC72cDEJjvSd5k x8hrGKvzE1BgkC6RZ/XB6jYSlTCqsFcEyRsXF3Jxci171hwRMEa2GOLitfE4GPZN07nCIO drJSPqjDWcW5SlK9yOFvHrAp7rfFlhg= X-AuditID: a67dfc5b-669ff7000002311f-90-67ff3f25994d Date: Wed, 16 Apr 2025 14:24:48 +0900 From: Byungchul Park To: Mina Almasry Cc: Jesper Dangaard Brouer , netdev , willy@infradead.org, ilias.apalodimas@linaro.org, kernel_team@skhynix.com, 42.hyeyoo@gmail.com, linux-mm@kvack.org Subject: Re: [RFC] shrinking struct page (part of page pool) Message-ID: <20250416052448.GB39145@system.software.com> References: <20250414013627.GA9161@system.software.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrELMWRmVeSWpSXmKPExsXC9ZZnka6q/f90g95vAhYTewwsVv+osNjT vp3ZorflN7PFvTX/WS2OLRCz+P1jDpsDu8fOWXfZPRZsKvXYvELLY9OqTjaPTZ8msXvcubaH zePzJrkA9igum5TUnMyy1CJ9uwSujKunV7M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vtn4g7GL5fdDzEKcDAq8fBGxP9LF2JNLCuuzD3EKMHB rCTCe84cKMSbklhZlVqUH19UmpNafIhRmoNFSZzXKzw1QUggPbEkNTs1tSC1CCbLxMEp1cCo /7Nj5WT7H1MtBHZMXLDxjsDBxeXRTftNjX6ovnL6+4Vjkvx9g7bzxi/F1l647G1wUXN7WrV9 9G/J2bp7bYry3eZ1GH8+N4e3rNcpTCq2SW/hjej9aqF2vx5nLVCyWrtGwkXdccv6vy79VVP3 B+9dzrymazJDt0ybaGCulrjswYszdrcLOzEqsRRnJBpqMRcVJwIAO4/QT20CAAA= X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 7712140004 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: ithxtyaes6zq49dc4de1hppadpjzau7y X-HE-Tag: 1744781097-267055 X-HE-Meta: U2FsdGVkX18J+Q/hdePp+QpXIuLlYrgvY7KGlA2aIQzi4U9JnuoHCVxtLU8YN/TBhRlflWp2kfKFDRCcBWlC7eOpGMsam9I5xi+414NFonPqJiUtQbnR2OpglAqhgcT0sF+HEGV+pwthcnsKSXgijWd27AU4d6ehzi3ySWY/ljnSLYhlT91fyWc4mo2cW4fQbF+JLAuzgCRZPlD6h+nzZTKcAyxaYymj+a5PoepjK18p2sWrRKwQQBdJZLGH1QKzZJqbmB+b8dKuI5or5qF95npAJRC8TB9iVJsii+6yO/8PJpMbsEKtcSWf4P1qtxZ4N8IOqdBmxcHmKPpJl0C1RMXWOO/11luK27l5uMJMfrNGwL0S8EhNwSdUFpluSy508Lig5r9myDwaid4DmEXMSW7/C66ezJQ8CU2ubYYW/VcbtMKtzV41zj9vTWZrdlILL+XwJah4NuvNtK1cEN3xjVvcmtyJ1ffmZ3qdZLoyCgs25WZGu7SVhJquH455PYYmFu8uj2OE1+OxJ3Nn/NE5H4AlBnj3HM6IW5EF/ryKS4DXVJ3uyTcMjFFUOLUpIAeuN3fyRZKBYDhCt8J4iZde2st0+BEnICKD58T+C1xVN5+v8ColO5Pj5N86SUxqfRnbpF6d9OyKRlBnuFelXJR4SQtLODTCZDyZdM9v2B2MTVYYkZ2A3IFagmHKTBXHaZJ4mQFF2SbLAVltbkG2vV89AwmU4ur1BD9KRD3uxTwHX0y3mMQJEDrCZvuNPtqSFAXx8vEQU4T+SfAZIjGhBflL1w3zU8PnPLJ4zN6TBrV5VJBitUSUFSMRvegwAL4gvQ68o4TjlFIufDeiiivV0trBxmVk/8eCUSRtlIgiAPC782HiY56r7gE7JO4nomQBxRuJnmoqioSJ991kdDX9uQpThSxaAucQoLvFu3Upuq4JHg5PhNbLCAScljm0OzV/LWmAiYtchFh179e2j5PnFSO 9CV1HlwW lBkE3QBp1+ULyD1BUFAdULgYg1KOMQyuJmFwomtvMpXffxIL77vYzUlQtrdJ0dPceOaA4v0ekEpFUUWVdMz2gMMt+/rJlJcEHwGK3CWZCLAc8+u9M7zGsZpHSfrivUT7Hj9OhZyoNWCKpv5Y8E5P76vsxqUWT18zqhDPtcDE6+3XGjjQ= X-Bogosity: Ham, tests=bogofilter, spamicity=0.001059, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Apr 15, 2025 at 08:39:47AM -0700, Mina Almasry wrote: > On Sun, Apr 13, 2025 at 6:36 PM Byungchul Park wrote: > > > > Hi guys, > > > > I'm looking at network's page pool code to help 'shrinking struct page' > > project by Matthew Wilcox. See the following link: > > > > https://kernelnewbies.org/MatthewWilcox/Memdescs/Path > > > > My first goal is to remove fields for page pool from struct page like: > > > > Remove them, but put them where? The page above specificies "Split the We need to introduce a new struct that will be used as a new descriptor e.g. bump, instead of struct page, similar to net_iov, overlaying struct page for now. > pagepool bump allocator out of struct page, as has been done for, eg, > slab and ptdesc.", but I'm not familiar what happened with slab and > ptdesc. Are these fields moving to a different location? Or being Move to the newly introduced struct e.g. bump and temporarily let it overlay struct page for now. > somehow removed entirely? And then we can remove the fields from struct page. > > struct { /* page_pool used by netstack */ > > /** > > * @pp_magic: magic value to avoid recycling non > > * page_pool allocated pages. > > */ > > unsigned long pp_magic; > > struct page_pool *pp; > > unsigned long _pp_mapping_pad; > > unsigned long dma_addr; > > atomic_long_t pp_ref_count; > > }; > > > > Fortunately, many prerequisite works have been done by Mina but I guess > > he or she has done it for other purpose than 'shrinking struct page'. > > > > Yeah, we did it to support non-page memory in the net stack, which is > quite orthogonal to what you're trying to do AFAICT so far. Looks like > maybe some implementation details are shared by luck? Oh. > > I'd like to just finalize the work so that the fields above can be > > removed from struct page. However, I need to resolve a curiousity > > before starting. > > > > Network guys already introduced a sperate strcut, struct net_iov, > > to overlay the interesting fields. However, another separate struct > > for system memory might be also needed e.g. struct bump so that > > struct net_iov and struct bump can be overlayed depending on the > > source: > > > > struct bump { > > unsigned long _page_flags; > > unsigned long bump_magic; > > struct page_pool *bump_pp; > > unsigned long _pp_mapping_pad; > > unsigned long dma_addr; > > atomic_long_t bump_ref_count; > > unsigned int _page_type; > > atomic_t _refcount; > > }; > > > > To netwrok guys, any thoughts on it? > > Need more details. What does struct bump represent? If it's meant to 'bump' comes from how page pool works. See the following link: https://en.wikipedia.org/wiki/Region-based_memory_management However, any better name suggestion from network guys should be appreciated. > replace the fields used by the page_pool referenced above, then it > should not have _page_flags, bump_ref_count should be pp_ref_count, > and should not have _page_type or _refcount. These are place holders that might be needed for now but should be removed later. > > To Willy, do I understand correctly your direction? > > > > Plus, it's a quite another issue but I'm curious, that is, what do you > > guys think about moving the bump allocator(= page pool) code from > > network to mm? I'd like to start on the work once gathering opinion > > from both Willy and network guys. > > > > What is the terminology "bump"? Are you wanting to rename page_pool to > "bump"? What does the new name mean? I hope the link above explain it. Byungchul > > -- > Thanks, > Mina