[PATCH 2/5] tests/intel/xe_exec_system_allocator: Add prefetch sections

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed Jul 16 10:58:14 UTC 2025


Hi Sharma,,
On 2025-07-15 at 13:35:58 +0530, Sharma, Nishit wrote:
> 
> On 7/14/2025 10:33 PM, Matthew Brost wrote:
> > Update the test_exec() function with flags to initiate and understand
> > prefetches. Prefetching is tested by verifying that the fault count in
> > the GT stats has not  increased. However, a mismatch does not cause the
> > test to fail—instead, a warning  is printed. This is due to the
> > unreliability of system allocator behavior; the  added sections
> > primarily serve to ensure that the driver remains stable.
> > 
> > That said, if the page fault counts are consistently incorrect, it may
> > indicate a  problem in the KMD.
> > 
> > A prefetch benchmark section has also been added to help profile
> > prefetch behavior  in the KMD.
> > 
> > v2:
> >   - Prefetch initial buffer on SRAM devices (CI)
> > 
> > Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> > ---
> >   tests/intel/xe_exec_system_allocator.c | 121 ++++++++++++++++++++++++-
> >   1 file changed, 116 insertions(+), 5 deletions(-)
> > 
> > diff --git a/tests/intel/xe_exec_system_allocator.c b/tests/intel/xe_exec_system_allocator.c
> > index 65d281c784..f8d144328e 100644
> > --- a/tests/intel/xe_exec_system_allocator.c
> > +++ b/tests/intel/xe_exec_system_allocator.c
> > @@ -21,6 +21,7 @@
> >   #include "lib/intel_reg.h"
> >   #include "xe_drm.h"
> > +#include "xe/xe_gt.h"
> >   #include "xe/xe_ioctl.h"
> >   #include "xe/xe_query.h"
> >   #include <string.h>
> > @@ -770,6 +771,10 @@ partial(int fd, struct drm_xe_engine_class_instance *eci, unsigned int flags)
> >   #define SYNC_EXEC		(0x1 << 19)
> >   #define EVERY_OTHER_CHECK	(0x1 << 20)
> >   #define MULTI_FAULT		(0x1 << 21)
> > +#define PREFETCH		(0x1 << 22)
> > +#define THREADS			(0x1 << 23)
> > +#define PROCESSES		(0x1 << 24)
> > +#define PREFETCH_BENCHMARK	(0x1 << 25)
> >   #define N_MULTI_FAULT		4
> > @@ -878,14 +883,17 @@ partial(int fd, struct drm_xe_engine_class_instance *eci, unsigned int flags)
> >    * arg[1]:
> >    *
> >    * @malloc:				malloc single buffer for all execs, issue a command which will trigger multiple faults
> > + * @malloc-prefetch:			malloc single buffer for all execs, prefetch buffer before each exec
> Length crossing limit of 100 columns

Here and below please allow this as this is already done
in other old lines here, not touched by this patch.
Checkpatch.pl warning is suggestion, here it should be
ignored.

Regards,
Kamil

> >    * @malloc-multi-fault:			malloc single buffer for all execs
> >    * @malloc-fork-read:			malloc single buffer for all execs, fork a process to read test output
> >    * @malloc-fork-read-after:		malloc single buffer for all execs, fork a process to read test output, check again after fork returns in parent
> >    * @malloc-mlock:			malloc and mlock single buffer for all execs
> >    * @malloc-race:			malloc single buffer for all execs with race between cpu and gpu access
> > + * @malloc-prefetch-race:		malloc single buffer for all execs, prefetch buffer before each exec, with race between cpu and gpu access
> Length crossing limit of 100 columns
> >    * @malloc-bo-unmap:			malloc single buffer for all execs, bind and unbind a BO to same address before execs
> >    * @malloc-busy:			malloc single buffer for all execs, try to unbind while buffer valid
> >    * @mmap:				mmap single buffer for all execs
> > + * @mmap-prefetch:			mmap single buffer for all execs, prefetch buffer before each exec
> Length crossing limit of 100 columns
> >    * @mmap-remap:				mmap and mremap a buffer for all execs
> >    * @mmap-remap-dontunmap:		mmap and mremap a buffer with dontunmap flag for all execs
> >    * @mmap-remap-ro:			mmap and mremap a read-only buffer for all execs
> > @@ -896,6 +904,7 @@ partial(int fd, struct drm_xe_engine_class_instance *eci, unsigned int flags)
> >    * @mmap-remap-ro-dontunmap-eocheck:	mmap and mremap a read-only buffer with dontunmap flag for all execs, check data every other loop iteration
> >    * @mmap-huge:				mmap huge page single buffer for all execs
> >    * @mmap-shared:			mmap shared single buffer for all execs
> > + * @mmap-prefetch-shared:		mmap shared single buffer for all execs, prefetch buffer before each exec
> Length crossing limit of 100 columns
> >    * @mmap-shared-remap:			mmap shared and mremap a buffer for all execs
> >    * @mmap-shared-remap-dontunmap:	mmap shared and mremap a buffer with dontunmap flag for all execs
> >    * @mmap-shared-remap-eocheck:		mmap shared and mremap a buffer for all execs, check data every other loop iteration

[cut]


More information about the igt-dev mailing list