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


Groups > linux.kernel > #1622993

Re: [PATCH] mm,hugetlb: compute page_size_log properly

From Matthew Wilcox <willy@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mm,hugetlb: compute page_size_log properly
Date 2017-04-13 14:50 +0200
Message-ID <tvMme-34k-11@gated-at.bofh.it> (permalink)
References <tiNg6-18z-13@gated-at.bofh.it> <tq2Dn-22K-7@gated-at.bofh.it> <tq2Dn-22K-9@gated-at.bofh.it> <tq3zr-2Gq-11@gated-at.bofh.it> <tvG78-7eb-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Apr 13, 2017 at 11:32:09AM +0530, Aneesh Kumar K.V wrote:
> > +#define SHM_HUGE_SHIFT	26
> > +#define SHM_HUGE_MASK	0x3f
> > +#define SHM_HUGE_2MB	(21 << SHM_HUGE_SHIFT)
> > +#define SHM_HUGE_8MB	(23 << SHM_HUGE_SHIFT)
> > +#define SHM_HUGE_1GB	(30 << SHM_HUGE_SHIFT)
> > +#define SHM_HUGE_16GB	(34 << SHM_HUGE_SHIFT)
> 
> This should be in arch/uapi like MAP_HUGE_2M ? That will let arch add
> #defines based on the hugepae size supported by them.

Well, what do we want to happen if source code contains SHM_HUGE_2MB?
Do we want it to fail to compile on ppc, or do we want it to request 2MB
pages and get ... hmm, looks like it fails at runtime (size_to_hstate
ends up returning NULL).  So, yeah, looks like a compile-time failure
would be better.

But speaking of MAP_HUGE_, the only definitions so far are in arch/x86.
Are you going to add the ppc versions?

Also, which header file?  I'm reluctant to add a new header, but
asm/shmbuf.h doesn't seem like a great place to put it.

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


Thread

Re: [PATCH] mm,hugetlb: compute page_size_log properly "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> - 2017-04-13 08:10 +0200
  Re: [PATCH] mm,hugetlb: compute page_size_log properly Matthew Wilcox <willy@infradead.org> - 2017-04-13 14:50 +0200

csiph-web