mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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:
parent
1bdc1698e6
commit
0020a1f5ca
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user