|
|
Subscribe / Log in / New account

tmpfs: HUGEPAGE and MEM_LOCK fcntls and memfds

From:  Hugh Dickins <hughd-AT-google.com>
To:  Andrew Morton <akpm-AT-linux-foundation.org>
Subject:  [PATCH 00/16] tmpfs: HUGEPAGE and MEM_LOCK fcntls and memfds
Date:  Fri, 30 Jul 2021 00:22:41 -0700
Message-ID:  <2862852d-badd-7486-3a8e-c5ea9666d6fb@google.com>
Cc:  Hugh Dickins <hughd-AT-google.com>, Shakeel Butt <shakeelb-AT-google.com>, "Kirill A. Shutemov" <kirill.shutemov-AT-linux.intel.com>, Yang Shi <shy828301-AT-gmail.com>, Miaohe Lin <linmiaohe-AT-huawei.com>, Mike Kravetz <mike.kravetz-AT-oracle.com>, Michal Hocko <mhocko-AT-suse.com>, Rik van Riel <riel-AT-surriel.com>, Christoph Hellwig <hch-AT-infradead.org>, Matthew Wilcox <willy-AT-infradead.org>, "Eric W. Biederman" <ebiederm-AT-xmission.com>, Alexey Gladkov <legion-AT-kernel.org>, Chris Wilson <chris-AT-chris-wilson.co.uk>, Matthew Auld <matthew.auld-AT-intel.com>, linux-fsdevel-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, linux-api-AT-vger.kernel.org, linux-mm-AT-kvack.org
Archive-link:  Article

A series of HUGEPAGE and MEM_LOCK tmpfs fcntls and memfd_create flags,
after fixes (not essential for stable) and cleanups in related areas.

Against 5.14-rc3: currently no conflict with linux-next or mmotm.

01/16 huge tmpfs: fix fallocate(vanilla) advance over huge pages
02/16 huge tmpfs: fix split_huge_page() after FALLOC_FL_KEEP_SIZE
03/16 huge tmpfs: remove shrinklist addition from shmem_setattr()
04/16 huge tmpfs: revert shmem's use of transhuge_vma_enabled()
05/16 huge tmpfs: move shmem_huge_enabled() upwards
06/16 huge tmpfs: shmem_is_huge(vma, inode, index)
07/16 memfd: memfd_create(name, MFD_HUGEPAGE) for shmem huge pages
08/16 huge tmpfs: fcntl(fd, F_HUGEPAGE) and fcntl(fd, F_NOHUGEPAGE)
09/16 huge tmpfs: decide stat.st_blksize by shmem_is_huge()
10/16 tmpfs: fcntl(fd, F_MEM_LOCK) to memlock a tmpfs file
11/16 tmpfs: fcntl(fd, F_MEM_LOCKED) to test if memlocked
12/16 tmpfs: refuse memlock when fallocated beyond i_size
13/16 mm: bool user_shm_lock(loff_t size, struct ucounts *)
14/16 mm: user_shm_lock(,,getuc) and user_shm_unlock(,,putuc)
15/16 tmpfs: permit changing size of memlocked file
16/16 memfd: memfd_create(name, MFD_MEM_LOCK) for memlocked shmem

 fs/fcntl.c                 |    8 
 fs/hugetlbfs/inode.c       |    4 
 include/linux/mm.h         |    4 
 include/linux/shmem_fs.h   |   31 ++-
 include/uapi/linux/fcntl.h |   17 +
 include/uapi/linux/memfd.h |    4 
 ipc/shm.c                  |    4 
 mm/huge_memory.c           |    6 
 mm/khugepaged.c            |    2 
 mm/memfd.c                 |   27 ++
 mm/mlock.c                 |   19 -
 mm/shmem.c                 |  397 ++++++++++++++++++++++++++-------------
 12 files changed, 370 insertions(+), 153 deletions(-)

Hugh


Copyright © 2021, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds