Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1533289

Re: [PATCHv5 22/36] mm, hugetlb: switch hugetlbfs to multi-order radix-tree entries

From "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCHv5 22/36] mm, hugetlb: switch hugetlbfs to multi-order radix-tree entries
Date 2016-11-30 14:20 +0100
Message-ID <sJcXL-6zu-5@gated-at.bofh.it> (permalink)
References <sIOLL-7NC-3@gated-at.bofh.it> <sIOLM-7NC-15@gated-at.bofh.it> <sJ9Qd-4q9-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 30, 2016 at 05:48:05PM +0800, Hillf Danton wrote:
> On Tuesday, November 29, 2016 7:23 PM Kirill A. Shutemov wrote:
> > @@ -607,10 +605,10 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
> >  		}
> > 
> >  		/* Set numa allocation policy based on index */
> > -		hugetlb_set_vma_policy(&pseudo_vma, inode, index);
> > +		hugetlb_set_vma_policy(&pseudo_vma, inode, index >> huge_page_order(h));
> > 
> >  		/* addr is the offset within the file (zero based) */
> > -		addr = index * hpage_size;
> > +		addr = index << PAGE_SHIFT & ~huge_page_mask(h);
> > 
> >  		/* mutex taken here, fault path and hole punch */
> >  		hash = hugetlb_fault_mutex_hash(h, mm, &pseudo_vma, mapping,
> 
> Seems we can't use index in computing hash as long as it isn't in huge page size.

Look at changes in hugetlb_fault_mutex_hash(): we shift the index right by
huge_page_order(), before calculating the hash. I don't see a problem
here.

-- 
 Kirill A. Shutemov

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv5 22/36] mm, hugetlb: switch hugetlbfs to multi-order radix-tree entries "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-11-29 12:30 +0100
  Re: [PATCHv5 22/36] mm, hugetlb: switch hugetlbfs to multi-order radix-tree entries "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-11-30 11:00 +0100
    Re: [PATCHv5 22/36] mm, hugetlb: switch hugetlbfs to multi-order  radix-tree entries "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-11-30 14:20 +0100
      Re: [PATCHv5 22/36] mm, hugetlb: switch hugetlbfs to multi-order radix-tree entries "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-12-01 04:20 +0100

csiph-web