[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHS8izM=fOXCbDykObwqxH9appKOR-NsQcHzQ=eEnKaJ7Upscw@mail.gmail.com>
Date: Fri, 9 Aug 2024 10:07:52 -0400
From: Mina Almasry <almasrymina@...gle.com>
To: Jesper Dangaard Brouer <hawk@...nel.org>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Ilias Apalodimas <ilias.apalodimas@...aro.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next v2] page_pool: unexport set dma_addr helper
On Fri, Aug 9, 2024 at 5:12 AM Jesper Dangaard Brouer <hawk@...nel.org> wrote:
>
>
>
> On 08/08/2024 23.45, Mina Almasry wrote:
> > This helper doesn't need to be exported. Move it to page_pool_priv.h
> >
> > Moving the implementation to the .c file allows us to hide netmem
> > implementation details in internal header files rather than the public
> > file.
> >
>
> Hmm, I worry this is a performance paper cut.
> AFAICT this cause the page_pool_set_dma_addr() to be a function call,
> while it before was inlined and on 64bit archs it is a simple assignment
> "page->dma_addr = addr".
>
> See below, maybe a simple 'static' function define will resolve this.
>
Unfortunately I can't static this function; I end up having to call it
from net/core/devmem.c file I'm adding, to set up netmem dma_addr. So
this is a genuine performance papercut.
To be honest, I didn't care much about preserving the inline. I think
the only call site of this function is the slowpath allocation which
does an alloc_pages_node(), and a dma mapping, so uninlining this
function should be a drop in the ocean AFAICT.
However, what I may be able to do is to put it as static inline in
page_pool_priv.h, if there are no objections. That accomplishes the
same thing for my purposes.
--
Thanks,
Mina
Powered by blists - more mailing lists