From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: brouer@redhat.com, tariqt@mellanox.com, toke@redhat.com,
davem@davemloft.net, netdev@vger.kernel.org,
mgorman@techsingularity.net, linux-mm@kvack.org
Subject: Re: [RFC, PATCH] net: page_pool: Don't use page->private to store dma_addr_t
Date: Thu, 7 Feb 2019 17:20:34 +0200 [thread overview]
Message-ID: <20190207152034.GA3295@apalos> (raw)
In-Reply-To: <20190207150745.GW21860@bombadil.infradead.org>
Hi Matthew,
On Thu, Feb 07, 2019 at 07:07:45AM -0800, Matthew Wilcox wrote:
> On Thu, Feb 07, 2019 at 04:36:36PM +0200, Ilias Apalodimas wrote:
> > +/* Until we can update struct-page, have a shadow struct-page, that
> > + * include our use-case
> > + * Used to store retrieve dma addresses from network drivers.
> > + * Never access this directly, use helper functions provided
> > + * page_pool_get_dma_addr()
> > + */
>
> Huh? Why not simply:
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 2c471a2c43fa..2495a93ad90c 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -28,6 +28,10 @@ struct address_space;
> struct mem_cgroup;
> struct hmm;
>
> +struct page_pool {
> + dma_addr_t dma_addr;
> +};
> +
> /*
> * Each physical page in the system has a struct page associated with
> * it to keep track of whatever it is we are using the page for at the
> @@ -77,6 +81,7 @@ struct page {
> * avoid collision and false-positive PageTail().
> */
> union {
> + struct page_pool pool;
> struct { /* Page cache and anonymous pages */
> /**
> * @lru: Pageout list, eg. active_list protected by
>
Well updating struct page is the final goal, hence the comment. I am mostly
looking for opinions here since we are trying to store dma addresses which are
irrelevant to pages. Having dma_addr_t definitions in mm-related headers is a
bit controversial isn't it ? If we can add that, then yes the code would look
better
Thanks
/Ilias
next prev parent reply other threads:[~2019-02-07 15: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 [this message]
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
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=20190207152034.GA3295@apalos \
--to=ilias.apalodimas@linaro.org \
--cc=brouer@redhat.com \
--cc=davem@davemloft.net \
--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).