mbox series

[v3,0/3] Introduce new field .hptype for reserving gigantic page

Message ID 20231106093031.1844129-1-liwang@redhat.com
Headers show
Series Introduce new field .hptype for reserving gigantic page | expand

Message

Li Wang Nov. 6, 2023, 9:30 a.m. UTC
In the beginning, I was just thinking of using specified .hpsize by users
to reserve gigantic or default huge pages. But after thinking over and
discussing with Richard, we both think that it might be easy to get typos and
limit the test case to run on more potential platforms.

Here change the field to .hptype with two enum TST_HUGE and TST_GIGANITC,
as the name suggests, if people want to reserve variant page size in their
case, this field could be defined.

But considering there are many different sizes and it could be configured
by linux users, we don't assume what the size of the gigantic page is, it
all depends on the system set, for instance, an aarch64 has four types:

    hugepages-1048576kB, hugepages-2048kB,
    hugepages-32768kB,    hugepages-64kB

LTP library will pick up the largest one as gigantic page. For a system
without configuring the 1GB or similar large size, it also gives a chance
to test on default hpage size. Compared with just TCONF on no-gigantic page,
this is adding test coverage.

(To Richard: the reason why I didn't go to use the smallest and second
 smallest size is because, platform like aarch64 typically configure many
 medium sizes for user, but the default huge is 2MB and gigantic is 1GB,
 that doesn't fit to most popular scenarios. But to x86_64, situations
 becomes common and easy, they only has two: 2MB, 1GB, this method could
 handle the case smoothly.)

Note: Patchset test passed on the RHEL8.9 and RHEL9.3 (x86_64/aarch64).

V2 --> V3
	* introduce new field .hptype
	* add enum tst_hp_type { TST_HUGE, TST_GIGANTIC }
	* drop the is_hugetlb_gigantic function
	* just choose the largest huge pagesize as gigantic

Li Wang (3):
  lib: add support for kinds of hpsize reservation
  hugemmap32: improvement test
  hugemmap34: Test to detect bug with migrating gigantic pages

 doc/C-Test-API.asciidoc                       |  42 +++++-
 include/tst_hugepage.h                        |  11 ++
 lib/tst_hugepage.c                            |  63 ++++++++-
 runtest/hugetlb                               |   1 +
 testcases/kernel/mem/.gitignore               |   1 +
 .../kernel/mem/hugetlb/hugemmap/hugemmap32.c  |  59 +-------
 .../kernel/mem/hugetlb/hugemmap/hugemmap34.c  | 129 ++++++++++++++++++
 7 files changed, 240 insertions(+), 66 deletions(-)
 create mode 100644 testcases/kernel/mem/hugetlb/hugemmap/hugemmap34.c