From: Matthew Wilcox <willy@infradead.org>
To: Jesper Dangaard Brouer <hawk@kernel.org>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
Jason Wang <jasowang@redhat.com>,
virtualization@lists.linux.dev,
"Michael S. Tsirkin" <mst@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Linux-MM <linux-mm@kvack.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH vhost 3/6] virtio_net: replace private by pp struct inside page
Date: Thu, 18 Apr 2024 22:56:17 +0100 [thread overview]
Message-ID: <ZiGXAWl1MR1rgQ5_@casper.infradead.org> (raw)
In-Reply-To: <ad98cb14-cc1b-4a01-aacc-8fb53445049e@kernel.org>
On Thu, Apr 18, 2024 at 10:19:33PM +0200, Jesper Dangaard Brouer wrote:
> I'm not sure it is "fine" to, explicitly choosing not to use page pool,
> and then (ab)use `struct page` member (pp) that intended for page_pool
> for other stuff. (In this case create a linked list of pages).
>
> +#define page_chain_next(p) ((struct page *)((p)->pp))
> +#define page_chain_add(p, n) ((p)->pp = (void *)n)
>
> I'm not sure that I (as PP maintainer) can make this call actually, as I
> think this area belong with the MM "page" maintainers (Cc MM-list +
> people) to judge.
>
> Just invention new ways to use struct page fields without adding your
> use-case to struct page, will make it harder for MM people to maintain
> (e.g. make future change).
I can't really follow what's being proposed; the quoting is quite deep.
Here's the current plan for struct page:
- The individual users are being split off. This has already happened
for struct folio, struct slab and struct pgdesc. Others are hopefully
coming.
- At some point, struct page will become:
struct page {
unsigned long flags;
unsigned long data[5];
unsigned int data2[2];
... some other bits and pieces ...
};
- After that, we will turn struct page into:
struct page {
unsigned long memdesc;
};
Users like pagepool will allocate a struct ppdesc that will be
referred to by the memdesc. The bottom 4 bits will identify it as a
ppdesc. You can put anything you like in a struct ppdesc, it just has
to be allocated from a slab with a 16 byte alignment.
More details here:
https://kernelnewbies.org/MatthewWilcox/Memdescs
This is all likely to land in 2025. The goal for 2024 is to remove
mapping & index from 'struct page'. This has been in progress since
2019 so I'm really excited that we're so close! If you want to
turn struct ppdesc into its own struct like folio, slab & ptdesc,
I'm happy to help. I once had a patchset for that:
https://lore.kernel.org/netdev/20221130220803.3657490-1-willy@infradead.org/
but I'm sure it's truly bitrotted.
next prev parent reply other threads:[~2024-04-18 21:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240411025127.51945-1-xuanzhuo@linux.alibaba.com>
[not found] ` <20240411025127.51945-4-xuanzhuo@linux.alibaba.com>
[not found] ` <CACGkMEsC7AEi2SOmqNOo6KJDpx92raGWYwYzxZ_MVhmnco_LYQ@mail.gmail.com>
[not found] ` <1712900153.3715405-1-xuanzhuo@linux.alibaba.com>
[not found] ` <CACGkMEvKC6JpsznW57GgxFBMhmMSk4eCZPvESpew9j5qfp9=RA@mail.gmail.com>
[not found] ` <1713146919.8867755-1-xuanzhuo@linux.alibaba.com>
[not found] ` <CACGkMEvmaH9NE-5VDBPpZOpAAg4bX39Lf0-iGiYzxdV5JuZWww@mail.gmail.com>
[not found] ` <1713170201.06163-2-xuanzhuo@linux.alibaba.com>
[not found] ` <CACGkMEvsXN+7HpeirxzR2qek_znHp8GtjiT+8hmt3tHHM9Zbgg@mail.gmail.com>
[not found] ` <1713171554.2423792-1-xuanzhuo@linux.alibaba.com>
[not found] ` <CACGkMEuK0VkqtNfZ1BUw+SW=gdasEegTMfufS-47NV4bCh3Seg@mail.gmail.com>
[not found] ` <1713317444.7698638-1-xuanzhuo@linux.alibaba.com>
[not found] ` <CACGkMEvjwXpF_mLR3H8ZW9PUE+3spcxKMQV1VvUARb0-Lt7NKQ@mail.gmail.com>
[not found] ` <1713342055.436048-1-xuanzhuo@linux.alibaba.com>
2024-04-18 20:19 ` Jesper Dangaard Brouer
2024-04-18 21:56 ` Matthew Wilcox [this message]
2024-04-19 7:11 ` Xuan Zhuo
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=ZiGXAWl1MR1rgQ5_@casper.infradead.org \
--to=willy@infradead.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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