From: Zi Yan <zi.yan@sent.com>
To: linux-mm@kvack.org, Matthew Wilcox <willy@infradead.org>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Roman Gushchin <guro@fb.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Yang Shi <shy828301@gmail.com>, Michal Hocko <mhocko@kernel.org>,
John Hubbard <jhubbard@nvidia.com>,
Ralph Campbell <rcampbell@nvidia.com>,
David Nellans <dnellans@nvidia.com>, Zi Yan <ziy@nvidia.com>
Subject: [RFC PATCH 0/6] Split huge pages to any lower order pages.
Date: Wed, 11 Nov 2020 15:40:02 -0500 [thread overview]
Message-ID: <20201111204008.21332-1-zi.yan@sent.com> (raw)
From: Zi Yan <ziy@nvidia.com>
Hi all,
With Matthew's THP in pagecache patches[1], we will be able to handle any size
pagecache THPs, but currently split_huge_page can only split a THP to order-0
pages. This can easily erase the benefit of having pagecache THPs, when
operations like truncate might want to keep pages larger than order-0. In
response, here is the patches to add support for splitting a THP to any lower
order pages. In addition, this patchset prepares for my PUD THP patchset[2],
since splitting a PUD THP to multiple PMD THPs can be handled by
split_huge_page_to_list_to_order function added by this patchset, which reduces
a lot of redundant code without just replicating split_huge_page for PUD THP.
The patchset is on top of Matthew's pagecache/next tree[3].
To ease the tests of split_huge_page functions, I added a new debugfs interface
at <debugfs>/split_huge_pages_in_range_pid, so developers can split THPs in a
given range from a process with the given pid by writing
"<pid>,<vaddr_start>,<vaddr_end>,<to_order>" to the interface. I also added a
new test program to test 1) split PMD THPs, 2) split pagecache THPs to any lower
order, and 3) truncating a pagecache THP to a page with a lower order.
Suggestions and comments are welcome. Thanks.
[1] https://lore.kernel.org/linux-mm/20201029193405.29125-1-willy@infradead.org/
[2] https://lore.kernel.org/linux-mm/20200928175428.4110504-1-zi.yan@sent.com/
[3] https://git.infradead.org/users/willy/pagecache.git/shortlog/refs/heads/next
Zi Yan (6):
mm: huge_memory: add new debugfs interface to trigger split huge page
on any page range.
mm: memcg: make memcg huge page split support any order split.
mm: page_owner: add support for splitting to any order in split
page_owner.
mm: thp: add support for split huge page to any lower order pages.
mm: truncate: split thp to a non-zero order if possible.
mm: huge_memory: enable debugfs to split huge pages to any order.
include/linux/huge_mm.h | 8 +
include/linux/memcontrol.h | 5 +-
include/linux/page_owner.h | 7 +-
mm/huge_memory.c | 177 ++++++++++--
mm/internal.h | 1 +
mm/memcontrol.c | 4 +-
mm/migrate.c | 2 +-
mm/page_alloc.c | 2 +-
mm/page_owner.c | 6 +-
mm/swap.c | 1 -
mm/truncate.c | 22 +-
tools/testing/selftests/vm/Makefile | 1 +
.../selftests/vm/split_huge_page_test.c | 255 ++++++++++++++++++
13 files changed, 453 insertions(+), 38 deletions(-)
create mode 100644 tools/testing/selftests/vm/split_huge_page_test.c
--
2.28.0
next reply other threads:[~2020-11-11 20:46 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-11 20:40 Zi Yan [this message]
2020-11-11 20:40 ` [RFC PATCH 1/6] mm: huge_memory: add new debugfs interface to trigger split huge page on any page range Zi Yan
2020-11-12 22:22 ` Ralph Campbell
2020-11-12 22:38 ` Zi Yan
2020-11-16 16:06 ` Kirill A. Shutemov
2020-11-16 17:26 ` Zi Yan
2020-11-11 20:40 ` [RFC PATCH 2/6] mm: memcg: make memcg huge page split support any order split Zi Yan
2020-11-12 17:58 ` Ralph Campbell
2020-11-12 18:00 ` Zi Yan
2020-11-14 0:23 ` Roman Gushchin
2020-11-14 0:56 ` Zi Yan
2020-11-11 20:40 ` [RFC PATCH 3/6] mm: page_owner: add support for splitting to any order in split page_owner Zi Yan
2020-11-12 17:57 ` Ralph Campbell
2020-11-12 17:59 ` Zi Yan
2020-11-14 0:15 ` Roman Gushchin
2020-11-14 1:08 ` Zi Yan
2020-11-14 1:38 ` Roman Gushchin
2020-11-17 21:05 ` Matthew Wilcox
2020-11-17 21:12 ` Zi Yan
2020-11-17 21:22 ` Matthew Wilcox
2020-11-17 21:25 ` Zi Yan
2020-11-17 21:35 ` Roman Gushchin
2020-11-17 21:43 ` Matthew Wilcox
2020-11-16 16:25 ` Kirill A. Shutemov
2020-11-16 17:27 ` Zi Yan
2020-11-17 21:10 ` Matthew Wilcox
2020-11-17 21:13 ` Zi Yan
2020-11-11 20:40 ` [RFC PATCH 4/6] mm: thp: add support for split huge page to any lower order pages Zi Yan
2020-11-12 22:01 ` Ralph Campbell
2020-11-12 22:20 ` Zi Yan
2020-11-14 0:52 ` Roman Gushchin
2020-11-14 1:00 ` Zi Yan
2020-11-11 20:40 ` [RFC PATCH 5/6] mm: truncate: split thp to a non-zero order if possible Zi Yan
2020-11-12 22:08 ` Ralph Campbell
2020-11-12 22:37 ` Zi Yan
2020-11-11 20:40 ` [RFC PATCH 6/6] mm: huge_memory: enable debugfs to split huge pages to any order Zi Yan
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=20201111204008.21332-1-zi.yan@sent.com \
--to=zi.yan@sent.com \
--cc=akpm@linux-foundation.org \
--cc=dnellans@nvidia.com \
--cc=guro@fb.com \
--cc=jhubbard@nvidia.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=rcampbell@nvidia.com \
--cc=shy828301@gmail.com \
--cc=willy@infradead.org \
--cc=ziy@nvidia.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;
as well as URLs for NNTP newsgroup(s).