[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180206183254.zsm276etjarud3lj@linux-n805>
Date: Tue, 6 Feb 2018 10:32:54 -0800
From: Davidlohr Bueso <dave@...olabs.net>
To: Laurent Dufour <ldufour@...ux.vnet.ibm.com>
Cc: Davidlohr Bueso <dbueso@...e.de>, akpm@...ux-foundation.org,
mingo@...nel.org, peterz@...radead.org, jack@...e.cz,
mhocko@...nel.org, kirill.shutemov@...ux.intel.com,
mawilcox@...rosoft.com, mgorman@...hsingularity.net,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/64] mm: teach pagefault paths about range locking
On Mon, 05 Feb 2018, Laurent Dufour wrote:
>> --- a/drivers/misc/sgi-gru/grufault.c
>> +++ b/drivers/misc/sgi-gru/grufault.c
>> @@ -189,7 +189,8 @@ static void get_clear_fault_map(struct gru_state *gru,
>> */
>> static int non_atomic_pte_lookup(struct vm_area_struct *vma,
>> unsigned long vaddr, int write,
>> - unsigned long *paddr, int *pageshift)
>> + unsigned long *paddr, int *pageshift,
>> + struct range_lock *mmrange)
>> {
>> struct page *page;
>>
>> @@ -198,7 +199,8 @@ static int non_atomic_pte_lookup(struct vm_area_struct *vma,
>> #else
>> *pageshift = PAGE_SHIFT;
>> #endif
>> - if (get_user_pages(vaddr, 1, write ? FOLL_WRITE : 0, &page, NULL) <= 0)
>> + if (get_user_pages(vaddr, 1, write ? FOLL_WRITE : 0,
>> + &page, NULL, mmrange) <= 0)
>
>There is no need to pass down the range here since underlying called
>__get_user_pages_locked() is told to not unlock the mmap_sem.
>In general get_user_pages() doesn't need a range parameter.
Yeah, you're right. At least it was a productive exercise for auditing.
Thanks,
Davidlohr
Powered by blists - more mailing lists