lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 Jul 2017 15:27:58 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc:     Matthew Wilcox <willy@...radead.org>, akpm@...ux-foundation.org,
        mhocko@...e.com, ak@...ux.intel.com, mtk.manpages@...il.com,
        Davidlohr Bueso <dbueso@...e.de>, khandual@...ux.vnet.ibm.com,
        aneesh.kumar@...ux.vnet.ibm.com, aarcange@...hat.com,
        Mike Kravetz <mike.kravetz@...cle.com>
Subject: Re: [PATCH] mm,hugetlb: compute page_size_log properly

I hate to resurrect this thread, but I would like to add hugetlb support
to memfd_create.  This is for JVM garbage collection as discussed in
this thread [1].

Adding hugetlb support to memfd_create, means that memfd_create will take
a flag something like MFD_HUGETLB.  And, if a user wants hugetlb pages
they may want a huge page size different than the system default.  So, it
make sense to use the same type of encoding used by mmap and shmget.
However, I would hate to copy/paste the same values used by mmap and shmget
and just give them different names.  So, how about something like the
following:

1) Put all the log2 encoded huge page size definitions in a common header
   file.
2) Arch specific code can use these values, or overwrite as needed.
3) All system calls using this encoding (mmap, shmget and memfd_create in
   the future) will use these common values.

I have also put the shm user space definitions in the uapi file as
previously suggested by Matthew Wilcox.  I did not (yet) move the
shm definitions to arch specific files as suggested by Aneesh Kumar.

[1] https://lkml.org/lkml/2017/7/6/564

Mike Kravetz (3):
  mm:hugetlb:  Define system call hugetlb size encodings in single file
  mm: arch: Use new hugetlb size encoding definitions
  mm: shm: Use new hugetlb size encoding definitions

 arch/alpha/include/uapi/asm/mman.h        | 14 ++++++--------
 arch/mips/include/uapi/asm/mman.h         | 14 ++++++--------
 arch/parisc/include/uapi/asm/mman.h       | 14 ++++++--------
 arch/powerpc/include/uapi/asm/mman.h      | 23 ++++++++++-------------
 arch/x86/include/uapi/asm/mman.h          | 10 ++++++++--
 arch/xtensa/include/uapi/asm/mman.h       | 14 ++++++--------
 include/linux/shm.h                       | 17 -----------------
 include/uapi/asm-generic/hugetlb_encode.h | 30 ++++++++++++++++++++++++++++++
 include/uapi/asm-generic/mman-common.h    |  6 ++++--
 include/uapi/linux/shm.h                  | 23 +++++++++++++++++++++--
 10 files changed, 97 insertions(+), 68 deletions(-)
 create mode 100644 include/uapi/asm-generic/hugetlb_encode.h

-- 
2.7.5

Powered by blists - more mailing lists