Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Randhawa, Jagmeet" <jagmeet.randhawa@intel.com>
To: Matthew Brost <matthew.brost@intel.com>, <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] tests/intel/xe_vm: Always have at least 2 pages bound in munmap hammer sections
Date: Fri, 12 Apr 2024 11:16:29 -0700	[thread overview]
Message-ID: <ba59280e-905e-4622-bbac-0c55b4d9cd47@intel.com> (raw)
In-Reply-To: <20240412041841.491326-2-matthew.brost@intel.com>


On 4/11/2024 9:18 PM, Matthew Brost wrote:
> If the prefetch buffer is 2k or larger the munmap hammer sections will
> prefetch the next page, if the page is unbound a fault will occur.
> Account for larger prefetchs by always having at least 2 pages bound for
> the hammer thread.
>
> v2:
>   - Missed table entry
> v3:
>   - Don't modify mmap section (Jonathan)
>   - Add assert to ensure no prefetch overrun (Matt Auld)
>
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
>   tests/intel/xe_vm.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
> index bd4973cc38..13cca27520 100644
> --- a/tests/intel/xe_vm.c
> +++ b/tests/intel/xe_vm.c
> @@ -1263,6 +1263,11 @@ test_munmap_style_unbind(int fd, struct drm_xe_engine_class_instance *eci,
>   	int exit = 0;
>   	int n_page_per_2mb = 0x200000 / xe_get_default_alignment(fd);
>   
> +	/* Ensure prefetch will not fetch an unmapped page */
> +	if (flags & MAP_FLAG_HAMMER_FIRST_PAGE)
> +		igt_assert(unbind_n_page_offset * 0x1000 >
> +			   xe_cs_prefetch_size(fd));
> +
>   	if (flags & MAP_FLAG_LARGE_PAGE) {
>   		bo_n_pages *= n_page_per_2mb;
>   		unbind_n_pages *= n_page_per_2mb;
> @@ -1843,12 +1848,12 @@ igt_main
>   		{ "all", 4, 2, 0, 4, 0 },
>   		{ "one-partial", 4, 1, 1, 2, 0 },
>   		{ "either-side-partial", 4, 2, 1, 2, 0 },
> -		{ "either-side-partial-hammer", 4, 2, 1, 2,
> +		{ "either-side-partial-hammer", 6, 2, 2, 2,
>   			MAP_FLAG_HAMMER_FIRST_PAGE },
> -		{ "either-side-partial-split-page-hammer", 4, 2, 1, 2,
> +		{ "either-side-partial-split-page-hammer", 6, 2, 2, 2,
>   			MAP_FLAG_HAMMER_FIRST_PAGE |
>   			MAP_FLAG_LARGE_PAGE },
> -		{ "either-side-partial-large-page-hammer", 4, 2, 1, 2,
> +		{ "either-side-partial-large-page-hammer", 6, 2, 2, 2,
>   			MAP_FLAG_HAMMER_FIRST_PAGE |
>   			MAP_FLAG_LARGE_PAGE |
>   			MAP_FLAG_LARGE_PAGE_NO_SPLIT },
> @@ -1857,7 +1862,7 @@ igt_main
>   		{ "front", 4, 2, 1, 3, 0 },
>   		{ "many-all", 4 * 8, 2 * 8, 0 * 8, 4 * 8, 0 },
>   		{ "many-either-side-partial", 4 * 8, 2 * 8, 1, 4 * 8 - 2, 0 },
> -		{ "many-either-side-partial-hammer", 4 * 8, 2 * 8, 1, 4 * 8 - 2,
> +		{ "many-either-side-partial-hammer", 4 * 8, 2 * 8, 2, 4 * 8 - 4,
>   			MAP_FLAG_HAMMER_FIRST_PAGE },
>   		{ "many-either-side-full", 4 * 8, 4 * 8, 1 * 8, 2 * 8, 0 },
>   		{ "many-end", 4 * 8, 4, 0 * 8, 3 * 8 + 2, 0 },
Reviewed-by: Jagmeet Randhawa <jagmeet.randhawa@intel.com>

  reply	other threads:[~2024-04-12 18:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12  4:18 [PATCH 1/2] Revert "tests/intel/xe_vm: Do not error on -ECANCELED" Matthew Brost
2024-04-12  4:18 ` [PATCH 2/2] tests/intel/xe_vm: Always have at least 2 pages bound in munmap hammer sections Matthew Brost
2024-04-12 18:16   ` Randhawa, Jagmeet [this message]
2024-04-12 18:28     ` [2/2] " Jonathan Cavitt
2024-04-12  4:51 ` ✓ CI.xeBAT: success for series starting with [1/2] Revert "tests/intel/xe_vm: Do not error on -ECANCELED" Patchwork
2024-04-12  4:59 ` ✓ Fi.CI.BAT: " Patchwork
2024-04-12 11:17 ` ✗ CI.xeFULL: failure " Patchwork
2024-04-12 12:04 ` ✗ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba59280e-905e-4622-bbac-0c55b4d9cd47@intel.com \
    --to=jagmeet.randhawa@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox