selftests/mm: hugepage_settings: use unsigned long in detect_hugetlb_page_size

... instead of size_t to avoid type mismatch in 32 and 64 bit builds.

Link: https://lore.kernel.org/20260511162840.375890-26-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Tested-by: Luiz Capitulino <luizcap@redhat.com>
Tested-by: Sarthak Sharma <sarthak.sharma@arm.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Donet Tom <donettom@linux.ibm.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Liam Howlett <liam@infradead.org>
Cc: Li Wang <li.wang@linux.dev>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Mike Rapoport (Microsoft) 2026-05-11 19:28:09 +03:00 committed by Andrew Morton
parent 1bdc1698e6
commit 0020a1f5ca
5 changed files with 7 additions and 7 deletions

View File

@ -37,7 +37,7 @@ static size_t pmdsize;
static int nr_thpsizes;
static size_t thpsizes[20];
static int nr_hugetlbsizes;
static size_t hugetlbsizes[10];
static unsigned long hugetlbsizes[10];
static int gup_fd;
static bool has_huge_zeropage;

View File

@ -33,7 +33,7 @@
static size_t pagesize;
static int nr_hugetlbsizes;
static size_t hugetlbsizes[10];
static unsigned long hugetlbsizes[10];
static int gup_fd;
static __fsword_t get_fs_type(int fd)

View File

@ -398,7 +398,7 @@ bool thp_is_enabled(void)
return mode == 1 || mode == 3;
}
int detect_hugetlb_page_sizes(size_t sizes[], int max)
int detect_hugetlb_page_sizes(unsigned long sizes[], int max)
{
DIR *dir = opendir("/sys/kernel/mm/hugepages/");
int count = 0;

View File

@ -90,7 +90,7 @@ bool thp_is_enabled(void);
/* HugeTLB */
int detect_hugetlb_page_sizes(size_t sizes[], int max);
int detect_hugetlb_page_sizes(unsigned long sizes[], int max);
unsigned long default_huge_page_size(void);
unsigned long get_free_hugepages(void);

View File

@ -12,12 +12,12 @@
#include "uffd-common.h"
static int pagemap_fd;
static size_t pagesize;
static int nr_pagesizes = 1;
static unsigned long pagesize;
static int nr_thpsizes;
static size_t thpsizes[20];
static int nr_hugetlbsizes;
static size_t hugetlbsizes[10];
static unsigned long hugetlbsizes[10];
static int detect_thp_sizes(size_t sizes[], int max)
{
@ -245,7 +245,7 @@ static void test_one_folio(uffd_global_test_opts_t *gopts, size_t size, bool pri
}
struct testcase {
size_t *sizes;
unsigned long *sizes;
int *nr_sizes;
bool private;
bool swapout;