From: Alexander H Duyck <alexander.duyck@gmail.com>
To: Yunsheng Lin <linyunsheng@huawei.com>,
davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
David Howells <dhowells@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Subject: Re: [PATCH net-next v1 01/12] mm: Move the page fragment allocator from page_alloc into its own file
Date: Sun, 07 Apr 2024 10:42:22 -0700 [thread overview]
Message-ID: <30a6635dedf305e23e623c501e614e55bca1ab41.camel@gmail.com> (raw)
In-Reply-To: <20240407130850.19625-2-linyunsheng@huawei.com>
On Sun, 2024-04-07 at 21:08 +0800, Yunsheng Lin wrote:
> Inspired by [1], but use free_unref_page() to replace free_the_page()
> instead of __free_pages(), use VM_BUG_ON() to catch that we can use
> free_unref_page() directly, also add its own header file.
Instead of doing this all as one patch it would be better to split this
into 2. Make the refactor first, and then move the code. Don't do it
all in one patch.
Adding a refactor that changes out functions called in addition to
moving the functions makes it very difficult to provide useful feedback
and review.
One of the big things with free_unref_page vx free_the_page is a check
to see how costly it is to free the page. Right now the page frags are
on the verge of crossing that threshold with defaulting to order 3
pages.
> As the API is only used by the networking, it may make sense to
> move it to the networking directory like the page_pool does in the
> future if we can make the free_unref_page() callable outside of the
> mm subsystem. And we can utilize that to decouple the 'struct page'
> in the networking subsystem in the future.
>
> 1. https://lore.kernel.org/all/20230411160902.4134381-3-dhowells@redhat.com/
The problem with moving this out to networking is the fact that this is
memory allocation. In my opinion it would better for it to live there.
> CC: David Howells <dhowells@redhat.com>
> Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
> ---
> include/linux/gfp.h | 22 -----
> include/linux/mm_types.h | 18 ----
> include/linux/page_frag_cache.h | 47 ++++++++++
> include/linux/skbuff.h | 1 +
> mm/Makefile | 1 +
> mm/page_alloc.c | 136 -----------------------------
> mm/page_frag_cache.c | 149 ++++++++++++++++++++++++++++++++
> 7 files changed, 198 insertions(+), 176 deletions(-)
> create mode 100644 include/linux/page_frag_cache.h
> create mode 100644 mm/page_frag_cache.c
I would add comments inline below about the changes you made but it is
hard to keep them in any sort of context since what is contained in the
"-" block is well spaced out from the "+" block.
next prev parent reply other threads:[~2024-04-07 17:42 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240407130850.19625-1-linyunsheng@huawei.com>
2024-04-07 13:08 ` Yunsheng Lin
2024-04-07 17:42 ` Alexander H Duyck [this message]
2024-04-08 13:38 ` Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 02/12] mm: page_frag: use initial zero offset for page_frag_alloc_align() Yunsheng Lin
2024-04-07 17:52 ` Alexander H Duyck
2024-04-08 13:39 ` Yunsheng Lin
2024-04-08 16:11 ` Alexander Duyck
2024-04-09 7:59 ` Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 03/12] mm: page_frag: change page_frag_alloc_* API to accept align param Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 04/12] mm: page_frag: add '_va' suffix to page_frag API Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 05/12] mm: page_frag: add two inline helper for " Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 06/12] mm: page_frag: reuse MSB of 'size' field for pfmemalloc Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 07/12] mm: page_frag: reuse existing bit field of 'va' for pagecnt_bias Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 09/12] mm: page_frag: introduce prepare/commit API for page_frag Yunsheng Lin
2024-04-07 13:08 ` [PATCH net-next v1 11/12] mm: page_frag: add a test module " Yunsheng Lin
2024-04-12 13:50 ` Simon Horman
2024-04-07 13:08 ` [PATCH net-next v1 12/12] mm: page_frag: update documentation and maintainer " Yunsheng Lin
2024-04-07 18:13 ` Alexander H Duyck
2024-04-08 13:39 ` Yunsheng Lin
2024-04-08 16:13 ` Alexander Duyck
2024-04-09 7:59 ` Yunsheng Lin
2024-04-09 13:25 ` Jakub Kicinski
2024-04-09 15:11 ` Alexander Duyck
2024-04-10 11:56 ` Yunsheng Lin
[not found] ` <6517b5ae-e302-4cbe-8a4c-716e604822ce@redhat.com>
2024-04-10 18:19 ` Alexander Duyck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=30a6635dedf305e23e623c501e614e55bca1ab41.camel@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linyunsheng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox