Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1697785
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions |
| Date | 2017-07-27 10:00 +0200 |
| Message-ID | <u7LS9-3l2-7@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <u4mQh-2yQ-7@gated-at.bofh.it> <u4mQi-2yQ-25@gated-at.bofh.it> <u7rgK-77f-23@gated-at.bofh.it> <u7rqq-7pw-17@gated-at.bofh.it> <u7yBz-3lo-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed 26-07-17 10:39:30, Mike Kravetz wrote: > On 07/26/2017 03:07 AM, Michal Hocko wrote: > > On Wed 26-07-17 11:53:38, Michal Hocko wrote: > >> On Mon 17-07-17 15:28:01, Mike Kravetz wrote: > >>> Use the common definitions from hugetlb_encode.h header file for > >>> encoding hugetlb size definitions in shmget system call flags. In > >>> addition, move these definitions to the from the internal to user > >>> (uapi) header file. > >> > >> s@to the from@from@ > >> > >>> > >>> Suggested-by: Matthew Wilcox <willy@infradead.org> > >>> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com> > >> > >> with s@HUGETLB_FLAG_ENCODE__16GB@HUGETLB_FLAG_ENCODE_16GB@ > >> > >> Acked-by: Michal Hocko <mhocko@suse.com> > > > > Btw. man page mentions only 2MB and 1GB, we should document others and > > note that each arch might support only subset of them > > Thanks for looking at these Michal. > BTW, those definitions below are wrong. They should be SHM_HUGE_*. :( Ups, and I completely missed that. > In the overview of this RFC, I mentioned still needing to address the > comment from Aneesh about splitting SHM_HUGE_* definitions into arch > specific header files. This is how it is done for mmap. If an arch > supports multiple huge page sizes, the 'asm/mman.h' contains definitions > for those sizes. There will be a bit of churn (such as header file > renaming) to do this for shm as well. So, I keep going back and forth > asking myself 'is it worth it'? Why cannot we use a generic header? Btw. I think it would be better for MMAP definitions as well. > Some things to consider. > > - We should be consistent between mmap and shm. Also remember, that I > will propose adding the same type of encoding to memfd_create. So, > three system calls will use the encoding. They should be consistent. agreed > - Adding the arch specific definitions seems the 'most correct', as a > user can not use a definition not supported by the arch. However, > even if an arch supports a huge page size it does not mean that the > running kernel supports that size. Therefore, the folllowing is in > the man page. > "The range of huge page sizes that are supported by the system > can be discovered by listing the subdirectories in > /sys/kernel/mm/hugepages." Doesn't the respective call return -EINVAL on the unsupported hugepage size? > - Another alternative is to make all known huge page sizes available > to all users. This is 'easier' as the definitions can likely reside > in a common header file. The user will need to determine what > huge page sizes are supported by the running kernel as mentioned in > the man page. yes I think this makes more sense. -- Michal Hocko SUSE Labs
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions Michal Hocko <mhocko@kernel.org> - 2017-07-26 12:00 +0200
Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions Michal Hocko <mhocko@kernel.org> - 2017-07-26 12:10 +0200
Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions Mike Kravetz <mike.kravetz@oracle.com> - 2017-07-26 19:50 +0200
Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions Matthew Wilcox <willy@infradead.org> - 2017-07-26 20:50 +0200
Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions Michal Hocko <mhocko@kernel.org> - 2017-07-27 10:00 +0200
Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions Mike Kravetz <mike.kravetz@oracle.com> - 2017-07-27 23:20 +0200
Re: [RFC PATCH 3/3] mm: shm: Use new hugetlb size encoding definitions Michal Hocko <mhocko@kernel.org> - 2017-07-28 08:40 +0200
csiph-web