From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Tariq Toukan <tariqt@mellanox.com>,
Matthew Wilcox <willy@infradead.org>,
"brouer@redhat.com" <brouer@redhat.com>,
David Miller <davem@davemloft.net>,
"toke@redhat.com" <toke@redhat.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"mgorman@techsingularity.net" <mgorman@techsingularity.net>,
"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [RFC, PATCH] net: page_pool: Don't use page->private to store dma_addr_t
Date: Tue, 12 Feb 2019 20:20:31 +0200 [thread overview]
Message-ID: <20190212182031.GA23057@apalos> (raw)
In-Reply-To: <CAKgT0UfG08aYoN=zO_aVyx+OgNPmN9pVkBNeZMPTF2KL7XqoBQ@mail.gmail.com>
Hi Alexander,
On Tue, Feb 12, 2019 at 10:13:30AM -0800, Alexander Duyck wrote:
> On Tue, Feb 12, 2019 at 7:16 AM Eric Dumazet <eric.dumazet@gmail.com> wrote:
> >
> >
> >
> > On 02/12/2019 04:39 AM, Tariq Toukan wrote:
> > >
> > >
> > > On 2/11/2019 7:14 PM, Eric Dumazet wrote:
> > >>
> > >>
> > >> On 02/11/2019 12:53 AM, Tariq Toukan wrote:
> > >>>
> > >>
> > >>> Hi,
> > >>>
> > >>> It's great to use the struct page to store its dma mapping, but I am
> > >>> worried about extensibility.
> > >>> page_pool is evolving, and it would need several more per-page fields.
> > >>> One of them would be pageref_bias, a planned optimization to reduce the
> > >>> number of the costly atomic pageref operations (and replace existing
> > >>> code in several drivers).
> > >>>
> > >>
> > >> But the point about pageref_bias is to place it in a different cache line than "struct page"
> > >>
> > >> The major cost is having a cache line bouncing between producer and consumer.
> > >>
> > >
> > > pageref_bias is meant to be dirtied only by the page requester, i.e. the
> > > NIC driver / page_pool.
> > > All other components (basically, SKB release flow / put_page) should
> > > continue working with the atomic page_refcnt, and not dirty the
> > > pageref_bias.
> >
> > This is exactly my point.
> >
> > You suggested to put pageref_bias in struct page, which breaks this completely.
> >
> > pageref_bias is better kept in a driver structure, with appropriate prefetching
> > since most NIC use a ring buffer for their queues.
> >
> > The dma address _can_ be put in the struct page, since the driver does not dirty it
> > and does not even read it when page can be recycled.
>
> Instead of maintaining the pageref_bias in the page itself it could be
> maintained in some sort of separate structure. You could just maintain
> a pointer to a slot in an array somewhere. Then you can still access
> it if needed, the pointer would be static for as long as it is in the
> page pool, and you could invalidate the pointer prior to removing the
> bias from the page.
I think that's what Tariq was suggesting in the first place.
/Ilias
next prev parent reply other threads:[~2019-02-12 18:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 14:36 [RFC, PATCH] net: page_pool: Don't use page->private to store dma_addr_t Ilias Apalodimas
2019-02-07 15:07 ` Matthew Wilcox
2019-02-07 15:20 ` Ilias Apalodimas
2019-02-07 21:25 ` David Miller
2019-02-07 21:34 ` Matthew Wilcox
2019-02-07 21:42 ` Ilias Apalodimas
2019-02-11 8:53 ` Tariq Toukan
2019-02-11 12:12 ` Matthew Wilcox
2019-02-11 15:38 ` Tariq Toukan
2019-02-11 17:14 ` Eric Dumazet
2019-02-12 12:39 ` Tariq Toukan
2019-02-12 13:49 ` Jesper Dangaard Brouer
2019-02-12 14:58 ` Tariq Toukan
2019-02-12 15:15 ` Eric Dumazet
2019-02-12 18:13 ` Alexander Duyck
2019-02-12 18:20 ` Ilias Apalodimas [this message]
2019-02-13 8:50 ` Tariq Toukan
2019-02-13 8:46 ` Tariq Toukan
2019-02-07 21:37 ` Ilias Apalodimas
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=20190212182031.GA23057@apalos \
--to=ilias.apalodimas@linaro.org \
--cc=alexander.duyck@gmail.com \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=netdev@vger.kernel.org \
--cc=tariqt@mellanox.com \
--cc=toke@redhat.com \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).