Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Michał Grzelak" <michal.grzelak@intel.com>
To: Krzysztof Karas <krzysztof.karas@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Andi Shyti <andi.shyti@linux.intel.com>,
	 Sebastian Brzezinka <sebastian.brzezinka@intel.com>,
	 Krzysztof Niemiec <krzysztof.niemiec@intel.com>,
	 Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Subject: Re: [PATCH v10 2/2] drm/i915/selftests: Run vma tests only if current->mm is present
Date: Fri, 8 May 2026 11:44:02 +0200 (CEST)	[thread overview]
Message-ID: <f8ba662b-3722-da3e-985e-708da7104fbb@intel.com> (raw)
In-Reply-To: <20260508080214.1979686-3-krzysztof.karas@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]

On Fri, 8 May 2026, Krzysztof Karas wrote:
> This set of tests require userspace memory to map objects, so
> run them only if this that memory is available.

I think the word "this" can be dropped from the description.

Otherwise,
Reviewed-by: Michał Grzelak <michal.grzelak@intel.com>

>
> Reviewed-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
> Reviewed-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
> ---
> .../gpu/drm/i915/gem/selftests/i915_gem_mman.c   | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> index 9d454d0b46f2..d01acfb7d93d 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> @@ -1847,11 +1847,12 @@ static int igt_mmap_revoke(void *arg)
> int i915_gem_mman_live_selftests(struct drm_i915_private *i915)
> {
> 	int ret;
> -	bool unuse_mm = false;
> 	static const struct i915_subtest tests[] = {
> 		SUBTEST(igt_partial_tiling),
> 		SUBTEST(igt_smoke_tiling),
> 		SUBTEST(igt_mmap_offset_exhaustion),
> +	};
> +	static const struct i915_subtest vma_tests[] = {
> 		SUBTEST(igt_mmap),
> 		SUBTEST(igt_mmap_migrate),
> 		SUBTEST(igt_mmap_access),
> @@ -1859,15 +1860,14 @@ int i915_gem_mman_live_selftests(struct drm_i915_private *i915)
> 		SUBTEST(igt_mmap_gpu),
> 	};
>
> -	if (!current->mm) {
> -		kthread_use_mm(current->active_mm);
> -		unuse_mm = true;
> -	}
> -
> 	ret = i915_live_subtests(tests, i915);
> +	if (ret)
> +		return ret;
>
> -	if (unuse_mm)
> -		kthread_unuse_mm(current->active_mm);
> +	if (current->mm)
> +		ret = i915_live_subtests(vma_tests, i915);
> +	else
> +		pr_warn("No current->mm to safely borrow userspace memory from. Skipping VMA tests.\n");
>
> 	return ret;
> }
> -- 
> 2.34.1
>
>

      reply	other threads:[~2026-05-08  9:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08  8:02 [PATCH v10 0/2] drm/i915/selftests: Use safe userspace memory for mappings Krzysztof Karas
2026-05-08  8:02 ` [PATCH v10 1/2] drm/i915/selftests: Prevent userspace mapping invalidation Krzysztof Karas
2026-05-08  8:53   ` Janusz Krzysztofik
2026-05-08  9:15   ` Sebastian Brzezinka
2026-05-08  9:41   ` Andi Shyti
2026-05-08  9:42   ` Michał Grzelak
2026-05-08  8:02 ` [PATCH v10 2/2] drm/i915/selftests: Run vma tests only if current->mm is present Krzysztof Karas
2026-05-08  9:44   ` Michał Grzelak [this message]

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=f8ba662b-3722-da3e-985e-708da7104fbb@intel.com \
    --to=michal.grzelak@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=krzysztof.karas@intel.com \
    --cc=krzysztof.niemiec@intel.com \
    --cc=sebastian.brzezinka@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