From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915/userptr: Probe vma range before gup
Date: Tue, 15 Jan 2019 10:52:52 +0000 [thread overview]
Message-ID: <49aff423-4b24-cfcd-a0b2-768db130326c@linux.intel.com> (raw)
In-Reply-To: <154754888818.30063.566033683249981416@skylake-alporthouse-com>
On 15/01/2019 10:41, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-01-15 10:27:02)
>>
>> On 14/01/2019 21:17, Chris Wilson wrote:
>>> + if (err)
>>> + goto err_unlock;
>>> +
>>> + err = __i915_gem_userptr_get_pages_schedule(obj);
>>> + if (err == -EAGAIN)
>>> __i915_gem_userptr_set_active(obj, true);
>>>
>>> - if (IS_ERR(pages))
>>> - release_pages(pvec, pinned);
>>> - kvfree(pvec);
>>> +err_unlock:
>>> + up_read(&mm->mmap_sem);
>>
>> May be safer to drop the lock earlier, immediately after probe. I don't
>> see holding it while queuing the worker and doing internal book-keeping
>> is useful and might just create more lock chain dependencies.
>
> Hmm, I thought we need to cover up to set-active (probe + queue + insert
> into rbtree) as I thought the mmu-invalidate was under the mmap_sem wlock.
We have our own lock for set active so I don't see that we need mmap_sem
for it. Certainly wasn't needed before this patch so don't see that
would change now.
Btw, what you said regarding nested mmap_sem.. do we have lock inversion
with it and obj->mm.lock then? I mean both mmap_sem -> obj->mm.lock and
obj->mm.lock -> mmap_sem chains?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-01-15 10:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-14 21:17 [PATCH 1/3] drm/i915: Prevent concurrent GGTT update and use on Braswell (again) Chris Wilson
2019-01-14 21:17 ` [PATCH 2/3] drm/i915/userptr: Avoid struct_mutex recursion for mmu_invalidate_range_start Chris Wilson
2019-01-15 9:47 ` Tvrtko Ursulin
2019-01-15 10:00 ` Chris Wilson
2019-01-15 11:25 ` Tvrtko Ursulin
2019-01-15 11:54 ` Tvrtko Ursulin
2019-01-15 11:58 ` Chris Wilson
2019-01-14 21:17 ` [PATCH 3/3] drm/i915/userptr: Probe vma range before gup Chris Wilson
2019-01-15 10:19 ` Tvrtko Ursulin
2019-01-15 10:30 ` Chris Wilson
2019-01-15 10:40 ` Tvrtko Ursulin
2019-01-15 11:59 ` Chris Wilson
2019-01-15 10:27 ` Tvrtko Ursulin
2019-01-15 10:41 ` Chris Wilson
2019-01-15 10:52 ` Tvrtko Ursulin [this message]
2019-01-15 12:03 ` Chris Wilson
2019-01-14 21:32 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915: Prevent concurrent GGTT update and use on Braswell (again) Patchwork
2019-01-14 21:58 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-15 3:58 ` ✓ Fi.CI.IGT: " Patchwork
2019-01-15 9:04 ` [PATCH 1/3] " Tvrtko Ursulin
2019-01-15 9:28 ` Chris Wilson
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=49aff423-4b24-cfcd-a0b2-768db130326c@linux.intel.com \
--to=tvrtko.ursulin@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.