lkml.org 
[lkml]   [2018]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2018-02-06 19:42    [W:0.130 / U:0.800 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site