[PATCH 2/2] xe_exec_system_allocator: Require huge pages reserved for huge page tests
Cavitt, Jonathan
jonathan.cavitt at intel.com
Tue Apr 29 20:45:48 UTC 2025
-----Original Message-----
From: Kamil Konieczny <kamil.konieczny at linux.intel.com>
Sent: Tuesday, April 29, 2025 1:37 PM
To: Cavitt, Jonathan <jonathan.cavitt at intel.com>
Cc: igt-dev at lists.freedesktop.org; Gupta, saurabhg <saurabhg.gupta at intel.com>; Zuo, Alex <alex.zuo at intel.com>; Brost, Matthew <matthew.brost at intel.com>
Subject: Re: [PATCH 2/2] xe_exec_system_allocator: Require huge pages reserved for huge page tests
>
> Hi Jonathan,
> On 2025-04-29 at 19:29:56 +0000, Jonathan Cavitt wrote:
>
> small nit about subject: use prefix, also avoid repetition,
> so instead of
>
> [PATCH 2/2] xe_exec_system_allocator: Require huge pages reserved for huge page tests
>
> write for example:
>
> [PATCH 2/2] tests/intel/xe_exec_system_allocator: Check for huge pages before thp tests
Fair enough. I would've done something like that, but during my initial attempts to write
the subject line for this patch, I wasn't able to find this wording, so my attempts always
exceeded the soft 75-character limit per line that we try to avoid. So, thank you for
finding this wording.
-Jonathan Cavitt
>
> Btw this could be done at merge.
>
> Regards,
> Kamil
>
> > Various subtests in xe_exec_system_allocator attempt to use the
> > MAP_HUGETLB flag for mmap. Doing so will result in an ENOMEM error if
> > there are no available huge pages, which can occur if none are reserved
> > before boot time. So, skip the tests if no huge pages have been
> > reserved by the kernel.
> >
> > Fixes: 41ee4d698fd8 ("tests/xe: Add system_allocator test")
> > Signed-off-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
> > Cc: Matthew Brost <matthew.brost at intel.com>
> > ---
> > tests/intel/xe_exec_system_allocator.c | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
> > index e1121a8627..8a55e0ff64 100644
> > --- a/tests/intel/xe_exec_system_allocator.c
> > +++ b/tests/intel/xe_exec_system_allocator.c
> > @@ -964,6 +964,12 @@ struct test_exec_data {
> > uint32_t expected_data;
> > };
> >
> > +static void igt_require_hugepages(void)
> > +{
> > + igt_skip_on_f(!igt_get_meminfo("HugePages_Total"),
> > + "Huge pages not reserved by the kernel!\n");
> > +}
> > +
> > static void
> > test_exec(int fd, struct drm_xe_engine_class_instance *eci,
> > int n_exec_queues, int n_execs, size_t bo_size,
> > @@ -1005,6 +1011,9 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
> > if (flags & EVERY_OTHER_CHECK && odd(n_execs))
> > return;
> >
> > + if (flags & HUGE_PAGE)
> > + igt_require_hugepages();
> > +
> > if (flags & EVERY_OTHER_CHECK)
> > igt_assert(flags & MREMAP);
> >
> > @@ -1439,6 +1448,9 @@ threads(int fd, int n_exec_queues, int n_execs, size_t bo_size,
> > if ((FILE_BACKED | FORK_READ) & flags)
> > return;
> >
> > + if (flags & HUGE_PAGE)
> > + igt_require_hugepages();
> > +
> > xe_for_each_engine(fd, hwe)
> > ++n_engines;
> >
> > @@ -1550,6 +1562,9 @@ processes(int fd, int n_exec_queues, int n_execs, size_t bo_size,
> > if (flags & FORK_READ)
> > return;
> >
> > + if (flags & HUGE_PAGE)
> > + igt_require_hugepages();
> > +
> > map_fd = open(sync_file, O_RDWR | O_CREAT, 0x666);
> > posix_fallocate(map_fd, 0, sizeof(*pdata));
> > pdata = mmap(NULL, sizeof(*pdata), PROT_READ |
> > --
> > 2.43.0
> >
>
More information about the igt-dev
mailing list