From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [FIXES 2/3] drm/i915/userptr: Handle unlocked gup retries
Date: Mon, 11 Nov 2019 15:44:50 +0000 [thread overview]
Message-ID: <aba78389-45bf-17b3-2eb7-a51329da873c@linux.intel.com> (raw)
In-Reply-To: <157348275112.28106.13456340027702285373@skylake-alporthouse-com>
On 11/11/2019 14:32, Chris Wilson wrote:
> Quoting Chris Wilson (2019-11-11 14:27:16)
>> Quoting Tvrtko Ursulin (2019-11-11 14:19:31)
>>>
>>> On 11/11/2019 13:32, Chris Wilson wrote:
>>>> Enable gup to retry and fault the pages outside of the mmap_sem lock in
>>>> our worker. As we are inside our worker, outside of any critical path,
>>>> we can allow the mmap_sem lock to be dropped in order to service a page
>>>> fault; this in turn allows the mm to populate the page using a slow
>>>> fault handler.
>>>>
>>>> Testcase: igt/gem_userptr/userfault
>>>
>>> There are no references or explanation on what does this fix?
>>
>> gup simply fails if it is not allowed to drop the lock for some faults,
>>
>> __get_user_pages_locked:
>> ret = __get_user_pages(tsk, mm, start, nr_pages, flags, pages,
>> vmas, locked);
>> if (!locked)
>> /* VM_FAULT_RETRY couldn't trigger, bypass */
>> return ret;
>>
>> userfault being the first time I discovered this even existed. Since we
>> are only holding the mmap_sem for the gup (and not protecting anything
>> else) we can simply allow gup to drop the lock if it needs to.
>
> Fixes: 5b56d49fc31d ("mm: add locked parameter to get_user_pages_remote()")
s/Fixes/Reference/ I guess.
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [FIXES 2/3] drm/i915/userptr: Handle unlocked gup retries
Date: Mon, 11 Nov 2019 15:44:50 +0000 [thread overview]
Message-ID: <aba78389-45bf-17b3-2eb7-a51329da873c@linux.intel.com> (raw)
Message-ID: <20191111154450.2eLNo6QI7XKi6uPq-G6SAFhWFHmI9-I9Bhc7W8BJqOg@z> (raw)
In-Reply-To: <157348275112.28106.13456340027702285373@skylake-alporthouse-com>
On 11/11/2019 14:32, Chris Wilson wrote:
> Quoting Chris Wilson (2019-11-11 14:27:16)
>> Quoting Tvrtko Ursulin (2019-11-11 14:19:31)
>>>
>>> On 11/11/2019 13:32, Chris Wilson wrote:
>>>> Enable gup to retry and fault the pages outside of the mmap_sem lock in
>>>> our worker. As we are inside our worker, outside of any critical path,
>>>> we can allow the mmap_sem lock to be dropped in order to service a page
>>>> fault; this in turn allows the mm to populate the page using a slow
>>>> fault handler.
>>>>
>>>> Testcase: igt/gem_userptr/userfault
>>>
>>> There are no references or explanation on what does this fix?
>>
>> gup simply fails if it is not allowed to drop the lock for some faults,
>>
>> __get_user_pages_locked:
>> ret = __get_user_pages(tsk, mm, start, nr_pages, flags, pages,
>> vmas, locked);
>> if (!locked)
>> /* VM_FAULT_RETRY couldn't trigger, bypass */
>> return ret;
>>
>> userfault being the first time I discovered this even existed. Since we
>> are only holding the mmap_sem for the gup (and not protecting anything
>> else) we can simply allow gup to drop the lock if it needs to.
>
> Fixes: 5b56d49fc31d ("mm: add locked parameter to get_user_pages_remote()")
s/Fixes/Reference/ I guess.
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
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-11-11 15:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 13:32 [FIXES 1/3] drm/i915/userptr: Try to acquire the page lock around set_page_dirty() Chris Wilson
2019-11-11 13:32 ` [Intel-gfx] " Chris Wilson
2019-11-11 13:32 ` [FIXES 2/3] drm/i915/userptr: Handle unlocked gup retries Chris Wilson
2019-11-11 13:32 ` [Intel-gfx] " Chris Wilson
2019-11-11 14:19 ` Tvrtko Ursulin
2019-11-11 14:19 ` [Intel-gfx] " Tvrtko Ursulin
2019-11-11 14:27 ` Chris Wilson
2019-11-11 14:27 ` [Intel-gfx] " Chris Wilson
2019-11-11 14:32 ` Chris Wilson
2019-11-11 14:32 ` [Intel-gfx] " Chris Wilson
2019-11-11 15:44 ` Tvrtko Ursulin [this message]
2019-11-11 15:44 ` Tvrtko Ursulin
2019-11-11 13:32 ` [FIXES 3/3] drm/i915/execlists: Move reset_active() from schedule-out to schedule-in Chris Wilson
2019-11-11 13:32 ` [Intel-gfx] " Chris Wilson
2019-11-11 16:31 ` Tvrtko Ursulin
2019-11-11 16:31 ` [Intel-gfx] " Tvrtko Ursulin
2019-11-11 16:34 ` Chris Wilson
2019-11-11 16:34 ` [Intel-gfx] " Chris Wilson
2019-11-11 14:12 ` [FIXES 1/3] drm/i915/userptr: Try to acquire the page lock around set_page_dirty() Tvrtko Ursulin
2019-11-11 14:12 ` [Intel-gfx] " Tvrtko Ursulin
2019-11-11 18:33 ` ✗ Fi.CI.BAT: failure for series starting with [FIXES,1/3] " Patchwork
2019-11-11 18:33 ` [Intel-gfx] " 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=aba78389-45bf-17b3-2eb7-a51329da873c@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.