lkml.org 
[lkml]   [2021]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v3 2/5] mm: add a signature in struct page
On Sat, 10 Apr 2021 20:39:55 +0100
Matthew Wilcox <willy@infradead.org> wrote:

> On Sat, Apr 10, 2021 at 09:27:31PM +0300, Ilias Apalodimas wrote:
> > > Can this page_pool be used for TCP RX zerocopy? If yes then PageType
> > > can not be used.
> >
> > Yes it can, since it's going to be used as your default allocator for
> > payloads, which might end up on an SKB.
> > So we have to keep the extra added field on struct page for our mark.
> > Matthew had an intersting idea. He suggested keeping it, but changing the
> > magic number, so it can't be a kernel address, but I'll let him follow
> > up on the details.
>
> Sure! So, given the misalignment problem I discovered yesterday [1],
> we probably want a page_pool page to look like:
>
> unsigned long flags;
> unsigned long pp_magic;
> unsigned long xmi;
> unsigned long _pp_mapping_pad;
> dma_addr_t dma_addr; /* might be one or two words */
>
> The only real restriction here is that pp_magic should not be a valid
> pointer, and it must have the bottom bit clear. I'd recommend something
> like:
>
> #define PP_MAGIC (0x20 + POISON_POINTER_DELTA)
>
> This leaves page->mapping as NULL, so you don't have to worry about
> clearing it before free.
>
> [1] https://lore.kernel.org/linux-mm/20210410024313.GX2531743@casper.infradead.org/

I didn't see this, before asking[2] for explaining your intent.
I still worry about page->index, see [2].

[2] https://lore.kernel.org/netdev/20210411114307.5087f958@carbon/

--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer

\
 
 \ /
  Last update: 2021-04-11 12:06    [W:0.129 / U:1.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site