From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: Andi Kleen <ak@linux.intel.com>, Davidlohr Bueso <dave@stgolabs.net>
Cc: akpm@linux-foundation.org, mhocko@suse.com,
mtk.manpages@gmail.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH] mm,hugetlb: compute page_size_log properly
Date: Thu, 9 Mar 2017 08:54:55 +0530 [thread overview]
Message-ID: <f10aee73-b288-ed21-682d-3d3727fdab2d@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170308193900.GC32070@tassilo.jf.intel.com>
On 03/09/2017 01:09 AM, Andi Kleen wrote:
>> One example of the problems with extra layers what this patch fixes:
>> mmap_pgoff() should never be using SHM_HUGE_* logic. This was
>> introduced by:
>>
>> 091d0d55b28 (shm: fix null pointer deref when userspace specifies invalid hugepage size)
>>
>> It is obviously harmless but lets just rip out the whole thing --
>> the shmget.2 manpage will need updating, as it should not be
>> describing kernel internals.
>
> The SHM_* defines were supposed to be exported to user space,
> but somehow they didn't make it into uapi.
Yeah, its not part of UAPI which it should have been. Now we
need to ilog2(page_size) and shift it before using them in
the user space. BTW, mmap() interface also would want this
encoding should we choose to use non default HugeTLB page
sizes.
>
> But something like this is useful, it's a much nicer
> interface for users than to hard code the bit position
Right. But as we need this both for shm and mmap() interface,
we can only have one set of values exported to the UAPI. The
other set needs to be removed IMHO. BTW, we need to add the
encoding for other arch supported HugeTLB supported sizes as
well like 16MB, 16GB etc (on POWER).
>
> So I would rather if you move it to uapi instead of
> removing. What the kernel uses internally doesn't
> really matter.
Had a sent a clean up patch last year which unfortunately I
forgot to resend though it has got ACK from Michal Hocko
and Balbir Singh.
https://lkml.org/lkml/2016/4/7/43
I had also tried to add POWER HugeTLB size encoding in the
arch specific header files. Probably its time to move all
of them to generic header.
https://lkml.org/lkml/2016/4/7/48
next prev parent reply other threads:[~2017-03-09 3:26 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 17:06 Davidlohr Bueso
2017-03-08 19:39 ` Andi Kleen
2017-03-09 3:24 ` Anshuman Khandual [this message]
2017-03-09 8:55 ` Michal Hocko
2017-03-28 16:53 ` Davidlohr Bueso
2017-03-28 16:55 ` Davidlohr Bueso
2017-03-28 17:54 ` Matthew Wilcox
2017-03-29 8:06 ` Michal Hocko
2017-03-29 17:45 ` Andi Kleen
2017-03-30 6:12 ` Michal Hocko
2017-04-12 16:18 ` Davidlohr Bueso
2017-04-12 16:30 ` Andi Kleen
2017-04-12 17:21 ` Matthew Wilcox
2017-04-13 6:02 ` Aneesh Kumar K.V
2017-04-13 12:46 ` Matthew Wilcox
2017-07-17 22:27 ` Mike Kravetz
2017-07-17 22:27 ` [RFC PATCH 1/3] mm:hugetlb: Define system call hugetlb size encodings in single file Mike Kravetz
2017-07-18 0:00 ` Matthew Wilcox
2017-07-26 9:50 ` Michal Hocko
2017-07-17 22:28 ` [RFC PATCH 2/3] mm: arch: Use new hugetlb size encoding definitions Mike Kravetz
2017-07-26 9:52 ` Michal Hocko
2017-07-17 22:28 ` [RFC PATCH 3/3] mm: shm: " Mike Kravetz
2017-07-26 9:53 ` Michal Hocko
2017-07-26 10:07 ` Michal Hocko
2017-07-26 17:39 ` Mike Kravetz
2017-07-26 18:48 ` Matthew Wilcox
2017-07-27 7:50 ` Michal Hocko
2017-07-27 21:18 ` Mike Kravetz
2017-07-28 6:30 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f10aee73-b288-ed21-682d-3d3727fdab2d@linux.vnet.ibm.com \
--to=khandual@linux.vnet.ibm.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=dbueso@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mtk.manpages@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome