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

From: Andi Kleen
Date: Wed Mar 08 2017 - 14:39:28 EST


> 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.

But something like this is useful, it's a much nicer
interface for users than to hard code the bit position

So I would rather if you move it to uapi instead of
removing. What the kernel uses internally doesn't
really matter.

-Andi