[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56A94BEB.8050504@sr71.net>
Date: Wed, 27 Jan 2016 14:59:55 -0800
From: Dave Hansen <dave@...1.net>
To: Vlastimil Babka <vbabka@...e.cz>, linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org, x86@...nel.org, dave.hansen@...ux.intel.com,
akpm@...ux-foundation.org, kirill.shutemov@...ux.intel.com,
aarcange@...hat.com, n-horiguchi@...jp.nec.com,
srikar@...ux.vnet.ibm.com, jack@...e.cz
Subject: Re: [PATCH] mm, gup: introduce concept of "foreign" get_user_pages()
On 01/27/2016 03:30 AM, Vlastimil Babka wrote:
>> > long __get_user_pages_unlocked(struct task_struct *tsk, struct mm_struct *mm,
>> > unsigned long start, unsigned long nr_pages,
>> > int write, int force, struct page **pages,
>> > unsigned int gup_flags)
>> > {
>> > long ret;
>> > - down_read(&mm->mmap_sem);
>> > - ret = get_user_pages(tsk, mm, start, nr_pages, write, force,
>> > - pages, NULL);
>> > - up_read(&mm->mmap_sem);
>> > + down_read(¤t->mm->mmap_sem);
>> > + ret = get_user_pages(start, nr_pages, write, force, pages, NULL);
>> > + up_read(¤t->mm->mmap_sem);
> I understand your reply to lkp report also means that this no longer locks
> current's mmap_sem? :)
Ahhh, good point. Now that we're passing them in again, we've got to
use them. That also makes it wrong to call get_user_pages() directly.
We should be using the __ variant so we can pass in the tsk/mm that came
into __get_user_pages_unlocked().
Updated version is attached.
View attachment "get_current_user_pages.patch" of type "text/x-patch" (39973 bytes)
Powered by blists - more mailing lists