All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915/gem: Mark up the racy read of the mmap_singleton
Date: Wed, 11 Mar 2020 14:02:24 +0200	[thread overview]
Message-ID: <87lfo714mn.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20200311092624.10012-3-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> [11057.642683] BUG: KCSAN: data-race in i915_gem_mmap [i915] / singleton_release [i915]
> [11057.642717]
> [11057.642740] write (marked) to 0xffff8881f24471a0 of 8 bytes by task 44668 on cpu 2:
> [11057.643162]  singleton_release+0x38/0x60 [i915]
> [11057.643192]  __fput+0x160/0x3c0
> [11057.643217]  ____fput+0x16/0x20
> [11057.643241]  task_work_run+0xba/0x100
> [11057.643263]  exit_to_usermode_loop+0xe4/0xf0
> [11057.643286]  do_syscall_64+0x27e/0x2c0
> [11057.643314]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
> [11057.643339]
> [11057.643359] read to 0xffff8881f24471a0 of 8 bytes by task 44667 on cpu 3:
> [11057.643774]  i915_gem_mmap+0x295/0x670 [i915]
> [11057.643802]  mmap_region+0x62b/0xac0
> [11057.643825]  do_mmap+0x414/0x6b0
> [11057.643848]  vm_mmap_pgoff+0xa9/0xf0
> [11057.643875]  ksys_mmap_pgoff+0x1ac/0x2f0
> [11057.643900]  do_syscall_64+0x6e/0x2c0
> [11057.643924]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> index e8cccc131c40..b39c24dae64e 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> @@ -775,7 +775,7 @@ static struct file *mmap_singleton(struct drm_i915_private *i915)
>  	struct file *file;
>  
>  	rcu_read_lock();
> -	file = i915->gem.mmap_singleton;
> +	file = READ_ONCE(i915->gem.mmap_singleton);
>  	if (file && !get_file_rcu(file))
>  		file = NULL;
>  	rcu_read_unlock();
> -- 
> 2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-11 12:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  9:26 [Intel-gfx] [PATCH 1/3] drm/i915/gt: Pull checking rps->pm_events under the irq_lock Chris Wilson
2020-03-11  9:26 ` [Intel-gfx] [PATCH 2/3] drm/i915/execlists: Track active elements during dequeue Chris Wilson
2020-03-11 11:17   ` Mika Kuoppala
2020-03-11  9:26 ` [Intel-gfx] [PATCH 3/3] drm/i915/gem: Mark up the racy read of the mmap_singleton Chris Wilson
2020-03-11 12:02   ` Mika Kuoppala [this message]
2020-03-11 13:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915/gt: Pull checking rps->pm_events under the irq_lock Patchwork
2020-03-12  5:20 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=87lfo714mn.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.