aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ipc/msg.c
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2021-09-02 14:54:21 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-09-03 09:58:11 -0700
commitd144bf6205342a4b5fed5d204ae18849a4de741b (patch)
tree3e015dccb761d5958ba455c8ef4ab796b88aa9d9 /ipc/msg.c
parenthuge tmpfs: fix fallocate(vanilla) advance over huge pages (diff)
downloadwireguard-linux-d144bf6205342a4b5fed5d204ae18849a4de741b.tar.xz
wireguard-linux-d144bf6205342a4b5fed5d204ae18849a4de741b.zip
huge tmpfs: fix split_huge_page() after FALLOC_FL_KEEP_SIZE
A successful shmem_fallocate() guarantees that the extent has been reserved, even beyond i_size when the FALLOC_FL_KEEP_SIZE flag was used. But that guarantee is broken by shmem_unused_huge_shrink()'s attempts to split huge pages and free their excess beyond i_size; and by other uses of split_huge_page() near i_size. It's sad to add a shmem inode field just for this, but I did not find a better way to keep the guarantee. A flag to say KEEP_SIZE has been used would be cheaper, but I'm averse to unclearable flags. The fallocend field is not perfect either (many disjoint ranges might be fallocated), but good enough; and gains another use later on. Link: https://lkml.kernel.org/r/ca9a146-3a59-6cd3-7f28-e9a044bb1052@google.com Fixes: 779750d20b93 ("shmem: split huge pages beyond i_size under memory pressure") Signed-off-by: Hugh Dickins <hughd@google.com> Reviewed-by: Yang Shi <shy828301@gmail.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Miaohe Lin <linmiaohe@huawei.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Rik van Riel <riel@surriel.com> Cc: Shakeel Butt <shakeelb@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/msg.c')
0 files changed, 0 insertions, 0 deletions