[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b3741e5a-2421-1f86-b688-58dc9bd501d2@oracle.com>
Date: Fri, 8 Mar 2019 15:08:57 -0800
From: Mike Kravetz <mike.kravetz@...cle.com>
To: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Davidlohr Bueso <dave@...olabs.net>
Cc: Joonsoo Kim <iamjoonsoo.kim@....com>,
Michal Hocko <mhocko@...nel.org>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 2/2] hugetlb: use same fault hash key for shared and
private mappings
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
Powered by blists - more mailing lists