* Use of mmap_sem in __qbuf_userptr()
@ 2015-03-05 14:27 Jan Kara
2015-03-06 9:17 ` Hans Verkuil
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2015-03-05 14:27 UTC (permalink / raw)
To: linux-media; +Cc: Hans Verkuil, Davidlohr Bueso
Hello,
so after a long pause I've got back to my simplification patches around
get_user_pages(). After the simplification done by commit f035eb4e976ef5
(videobuf2: fix lockdep warning) it seems unnecessary to take mmap_sem
already when calling __qbuf_userptr(). As far as I understand what
__qbuf_userptr() does, the only thing where mmap_sem is needed is for
get_userptr and possibly put_userptr memops. So it should be possible to
push mmap_sem locking down into these memops, shouldn't it? Or am I missing
something in __qbuf_userptr() for which mmap_sem is also necessary?
If I'm right, I can prepare patches to do that (and then on top of those
rebase patches which will make v4l2 core use some mm helper functions so
they don't have to care about details of mm locking, vmas, etc.).
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Use of mmap_sem in __qbuf_userptr()
2015-03-05 14:27 Use of mmap_sem in __qbuf_userptr() Jan Kara
@ 2015-03-06 9:17 ` Hans Verkuil
0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2015-03-06 9:17 UTC (permalink / raw)
To: Jan Kara, linux-media; +Cc: Hans Verkuil, Davidlohr Bueso
Hi Jan,
On 03/05/2015 03:27 PM, Jan Kara wrote:
> Hello,
>
> so after a long pause I've got back to my simplification patches around
> get_user_pages(). After the simplification done by commit f035eb4e976ef5
> (videobuf2: fix lockdep warning) it seems unnecessary to take mmap_sem
> already when calling __qbuf_userptr(). As far as I understand what
> __qbuf_userptr() does, the only thing where mmap_sem is needed is for
> get_userptr and possibly put_userptr memops. So it should be possible to
> push mmap_sem locking down into these memops, shouldn't it? Or am I missing
> something in __qbuf_userptr() for which mmap_sem is also necessary?
No, you are correct. The mmap_sem can be pushed down, either to __qbuf_userptr
or all the way to the videobuf2-dma/vmalloc get/put_userptr ops.
> If I'm right, I can prepare patches to do that (and then on top of those
> rebase patches which will make v4l2 core use some mm helper functions so
> they don't have to care about details of mm locking, vmas, etc.).
That would be really nice.
Regards,
Hans
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-06 9:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 14:27 Use of mmap_sem in __qbuf_userptr() Jan Kara
2015-03-06 9:17 ` Hans Verkuil
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).