linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: John Hubbard <jhubbard@nvidia.com>
Cc: Jan Kara <jack@suse.cz>,
	lsf-pc@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-mm@kvack.org, Dan Williams <dan.j.williams@intel.com>,
	Jerome Glisse <jglisse@redhat.com>
Subject: Re: [LSF/MM TOPIC] get_user_pages() pins in file mappings
Date: Tue, 5 Feb 2019 12:21:07 +0100	[thread overview]
Message-ID: <20190205112107.GB3872@quack2.suse.cz> (raw)
In-Reply-To: <a0d37cc9-2d44-ac58-0dc0-c245a55082c3@nvidia.com>

Hi John,

On Mon 04-02-19 15:46:10, John Hubbard wrote:
> On 1/24/19 1:04 AM, Jan Kara wrote:
> 
> > In particular we hope to have reasonably robust mechanism of identifying
> > pages pinned by GUP (patches will be posted soon) - I'd like to run that by
> > MM folks (unless discussion happens on mailing lists before LSF/MM). We
> > also have ideas how filesystems should react to pinned page in their
> > writepages methods - there will be some changes needed in some filesystems
> > to bounce the page if they need stable page contents. So I'd like to
> > explain why we chose to do bouncing to fs people (i.e., why we cannot just
> > wait, skip the page, do something else etc.) to save us from the same
> > discussion with each fs separately and also hash out what the API for
> > filesystems to do this should look like. Finally we plan to keep pinned
> > page permanently dirty - again something I'd like to explain why we do this
> > and gather input from other people.
> 
> Hi Jan,
> 
> Say, I was just talking through this point with someone on our driver team, 
> and suddenly realized that I'm now slightly confused on one point. If we end
> up keeping the gup-pinned pages effectively permanently dirty while pinned,
> then maybe the call sites no longer need to specify "dirty" (or not) when
> they call put_user_page*()?
> 
> In other words, the RFC [1] has this API:
> 
>     void put_user_page(struct page *page);
>     void put_user_pages_dirty(struct page **pages, unsigned long npages);
>     void put_user_pages_dirty_lock(struct page **pages, unsigned long npages);
>     void put_user_pages(struct page **pages, unsigned long npages);
> 
> But maybe we only really need this:
> 
>     void put_user_page(struct page *page);
>     void put_user_pages(struct page **pages, unsigned long npages);
> 
> ?
> 
> [1] https://lkml.kernel.org/r/20190204052135.25784-1-jhubbard@nvidia.com

So you are right that if we keep gup-pinned pages dirty, drivers could get
away without marking them as such. However I view "keep pages dirty" as an
implementation detail, rather than a promise of the API. So I'd like to
leave us the flexibility of choosing a different implementation in the
future. And as such I'd just leave the put_user_pages_dirty() variants in
place.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2019-02-05 11:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24  9:04 [LSF/MM TOPIC] get_user_pages() pins in file mappings Jan Kara
2019-01-26  2:58 ` John Hubbard
2019-02-04 23:46 ` John Hubbard
2019-02-05 11:21   ` Jan Kara [this message]
2019-02-06  2:10     ` John Hubbard

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=20190205112107.GB3872@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=dan.j.williams@intel.com \
    --cc=jglisse@redhat.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lsf-pc@lists.linux-foundation.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).