lkml.org 
[lkml]   [2019]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] hugetlb: use same fault hash key for shared and private mappings
From
Date
On 3/8/19 2:48 PM, Mike Kravetz wrote:
> mm/hugetlb.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 64ef640126cd..0527732c71f0 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3904,13 +3904,8 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
> unsigned long key[2];
> u32 hash;
>
> - if (vma->vm_flags & VM_SHARED) {
> - key[0] = (unsigned long) mapping;
> - key[1] = idx;
> - } else {
> - key[0] = (unsigned long) mm;
> - key[1] = address >> huge_page_shift(h);
> - }
> + key[0] = (unsigned long) mapping;
> + key[1] = idx;
>
> hash = jhash2((u32 *)&key, sizeof(key)/sizeof(u32), 0);

Duh!

If we no longer use mm and address they can be dropped from the function
arguments and all callers. Before doing that, let's see if there is any
objection to using the same key for shared and private mappings.

--
Mike Kravetz

\
 
 \ /
  Last update: 2019-03-09 00:09    [W:0.041 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site