From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>, LKML <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, Alexander Viro <viro@zeniv.linux.org.uk>,
Andreas Dilger <andreas.dilger@intel.com>,
Andy Walls <awalls@md.metrocast.net>,
Arnd Bergmann <arnd@arndb.de>, Benjamin LaHaise <bcrl@kvack.org>,
ceph-devel@vger.kernel.org,
Dan Williams <dan.j.williams@intel.com>,
David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, Gleb Natapov <gleb@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
hpdd-discuss@ml01.01.org, Jarod Wilson <jarod@wilsonet.com>,
Jayant Mangalampalli <jayant.mangalampalli@intel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Jesper Nilsson <jesper.nilsson@axis.com>,
Kai Makisara <Kai.Makisara@kolumbus.fi>,
kvm@vger.kernel.org,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-aio@kvack.org, linux-cris-kernel@axis.com, linux-fbdev@
Subject: Re: [PATCH 0/26] get_user_pages() cleanup
Date: Wed, 2 Oct 2013 22:29:41 +0200 [thread overview]
Message-ID: <20131002202941.GF16998@quack.suse.cz> (raw)
In-Reply-To: <20131002162009.GA5778@infradead.org>
On Wed 02-10-13 09:20:09, Christoph Hellwig wrote:
> On Wed, Oct 02, 2013 at 04:27:41PM +0200, Jan Kara wrote:
> > Hello,
> >
> > In my quest for changing locking around page faults to make things easier for
> > filesystems I found out get_user_pages() users could use a cleanup. The
> > knowledge about necessary locking for get_user_pages() is in tons of places in
> > drivers and quite a few of them actually get it wrong (don't have mmap_sem when
> > calling get_user_pages() or hold mmap_sem when calling copy_from_user() in the
> > surrounding code). Rather often this actually doesn't seem necessary. This
> > patch series converts lots of places to use either get_user_pages_fast()
> > or a new simple wrapper get_user_pages_unlocked() to remove the knowledge
> > of mmap_sem from the drivers. I'm still looking into converting a few remaining
> > drivers (most notably v4l2) which are more complex.
>
> Even looking over the kerneldoc comment next to it I still fail to
> understand when you'd want to use get_user_pages_fast and when not.
AFAIU get_user_pages_fast() should be used
1) if you don't need any special get_user_pages() arguments (like calling
it for mm of a different process, forcing COW, or similar).
2) you don't expect pages to be unmapped (then get_user_pages_fast() is
actually somewhat slower because it walks page tables twice).
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org. For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
next prev parent reply other threads:[~2013-10-02 20:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-02 14:27 [PATCH 0/26] get_user_pages() cleanup Jan Kara
2013-10-02 14:28 ` [PATCH 26/26] aio: Remove useless get_user_pages() call Jan Kara
2013-10-02 16:20 ` [PATCH 0/26] get_user_pages() cleanup Christoph Hellwig
2013-10-02 20:29 ` Jan Kara [this message]
2013-10-04 20:31 ` KOSAKI Motohiro
2013-10-04 20:42 ` KOSAKI Motohiro
2013-10-07 21:18 ` Jan Kara
2013-10-08 0:27 ` KOSAKI Motohiro
2013-10-08 6:06 ` Jan Kara
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=20131002202941.GF16998@quack.suse.cz \
--to=jack@suse.cz \
--cc=Kai.Makisara@kolumbus.fi \
--cc=airlied@linux.ie \
--cc=andreas.dilger@intel.com \
--cc=arnd@arndb.de \
--cc=awalls@md.metrocast.net \
--cc=bcrl@kvack.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dan.j.williams@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gleb@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=hpdd-discuss@ml01.01.org \
--cc=jarod@wilsonet.com \
--cc=jayant.mangalampalli@intel.com \
--cc=jesper.nilsson@axis.com \
--cc=kvm@vger.kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-aio@kvack.org \
--cc=linux-cris-kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=plagnioj@jcrosoft.com \
--cc=viro@zeniv.linux.org.uk \
/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).