All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@linux.intel.com>
To: Mikolaj Wasiak <mikolaj.wasiak@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Krzysztof Karas <krzysztof.karas@intel.com>,
	chris.p.wilson@intel.com
Subject: Re: [PATCH v2] i915/selftest/igt_mmap: let mmap tests run in kthread
Date: Fri, 14 Mar 2025 16:18:50 +0100	[thread overview]
Message-ID: <Z9RI2tcFb7e2-jwb@ashyti-mobl2.lan> (raw)
In-Reply-To: <2w6pt2hnemndwmanwhyn3keexa6vtha7rmo6rqoerkmyxhbrh2@ls7lndjpia6z>

Hi Mikolaj,

On Tue, Mar 04, 2025 at 09:43:26AM +0100, Mikolaj Wasiak wrote:
> When the driver is loaded on the system with numa nodes it might be run in
> a kthread, which makes it impossible to use current->mm in the selftest.
> This patch allows the selftest to use current->mm by using active_mm.
> 
> Signed-off-by: Mikolaj Wasiak <mikolaj.wasiak@intel.com>
> Reviewed-by: Eugene Kobyak <eugene.kobyak@intel.com>

merged to drm-intel-gt-next.

Thanks,
Andi

> ---
> v1 -> v2: Simplify logic of enabling and disabling active_mm
> 
>  drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> 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 804f74084bd4..9c3f17e51885 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
> @@ -1837,6 +1837,8 @@ 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),
> @@ -1848,5 +1850,15 @@ int i915_gem_mman_live_selftests(struct drm_i915_private *i915)
>  		SUBTEST(igt_mmap_gpu),
>  	};
>  
> -	return i915_live_subtests(tests, i915);
> +	if (!current->mm) {
> +		kthread_use_mm(current->active_mm);
> +		unuse_mm = true;
> +	}
> +
> +	ret = i915_live_subtests(tests, i915);
> +
> +	if (unuse_mm)
> +		kthread_unuse_mm(current->active_mm);
> +
> +	return ret;
>  }
> -- 
> 2.43.0

      parent reply	other threads:[~2025-03-14 15:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04  8:43 [PATCH v2] i915/selftest/igt_mmap: let mmap tests run in kthread Mikolaj Wasiak
2025-03-04 11:37 ` ✓ i915.CI.BAT: success for i915/selftest/igt_mmap: let mmap tests run in kthread (rev2) Patchwork
2025-03-04 15:28 ` ✓ i915.CI.BAT: success for i915/selftest/igt_mmap: let mmap tests run in kthread (rev3) Patchwork
2025-03-05  3:08 ` ✗ i915.CI.Full: failure for i915/selftest/igt_mmap: let mmap tests run in kthread (rev2) Patchwork
2025-03-05  6:35 ` ✗ i915.CI.Full: failure for i915/selftest/igt_mmap: let mmap tests run in kthread (rev3) Patchwork
2025-03-05 16:31 ` [PATCH v2] i915/selftest/igt_mmap: let mmap tests run in kthread Krzysztof Niemiec
2025-03-07  7:44   ` Mikolaj Wasiak
2025-03-07 11:31     ` Chris Wilson
2025-03-07 12:14       ` Mikolaj Wasiak
2025-03-07 13:18       ` Krzysztof Niemiec
2025-03-11 10:37         ` Krzysztof Karas
2025-03-14 14:26 ` Andi Shyti
2025-03-14 15:18 ` Andi Shyti [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=Z9RI2tcFb7e2-jwb@ashyti-mobl2.lan \
    --to=andi.shyti@linux.intel.com \
    --cc=chris.p.wilson@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=krzysztof.karas@intel.com \
    --cc=mikolaj.wasiak@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.