Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1509015
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls |
| Date | 2016-10-26 12:00 +0200 |
| Message-ID | <swta2-1Sm-3@gated-at.bofh.it> (permalink) |
| References | <swju2-3SL-19@gated-at.bofh.it> <swjDI-3W4-3@gated-at.bofh.it> <swsxk-1EJ-35@gated-at.bofh.it> <swsQH-1Lu-53@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed 26-10-16 10:39:13, Lorenzo Stoakes wrote: > On Wed, Oct 26, 2016 at 11:15:43AM +0200, Michal Hocko wrote: > > On Wed 26-10-16 00:46:31, Lorenzo Stoakes wrote: > > > The holdout for unexporting __get_user_pages_unlocked() is its invocation in > > > mm/process_vm_access.c: process_vm_rw_single_vec(), as this definitely _does_ > > > seem to invoke VM_FAULT_RETRY behaviour which get_user_pages_remote() will not > > > trigger if we were to replace it with the latter. > > > > I am not sure I understand. Prior to 1e9877902dc7e this used > > get_user_pages_unlocked. What prevents us from reintroducing it with > > FOLL_REMOVE which was meant to be added by the above commit? > > > > Or am I missing your point? > > The issue isn't the flags being passed, rather that in this case: > > a. Replacing __get_user_pages_unlocked() with get_user_pages_unlocked() won't > work as the latter assumes task = current and mm = current->mm but > process_vm_rw_single_vec() needs to pass different task, mm. Ohh, right. I should have checked more closely. > b. Moving to get_user_pages_remote() _will_ allow us to pass different task, mm > but won't however match existing behaviour precisely, since > __get_user_pages_unlocked() acquires mmap_sem then passes a pointer to a > local 'locked' variable to __get_user_pages_locked() which allows > VM_FAULT_RETRY to trigger. I do not see any reason why get_user_pages_remote should implicitely disallow VM_FAULT_RETRY. Releasing the mmap_sem on a remote task when we have to wait for IO is a good thing in general. So I would rather see a way to do allow that. Doing that implicitly sounds too dangerous and maybe we even have users which wouldn't cope with the mmap sem being dropped (get_arg_page sounds like a potential example) so I would rather add locked * parameter to get_user_pages_remote. -- Michal Hocko SUSE Labs
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-26 01:40 +0200
Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-26 01:50 +0200
Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Michal Hocko <mhocko@kernel.org> - 2016-10-26 11:20 +0200
Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-26 11:40 +0200
Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Michal Hocko <mhocko@kernel.org> - 2016-10-26 12:00 +0200
Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-26 10:10 +0200
Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Michal Hocko <mhocko@kernel.org> - 2016-10-26 11:10 +0200
Re: [PATCH] mm: remove unnecessary __get_user_pages_unlocked() calls Michal Hocko <mhocko@kernel.org> - 2016-10-26 11:20 +0200
[PATCH v2] mm: remove unnecessary __get_user_pages_unlocked() calls Lorenzo Stoakes <lstoakes@gmail.com> - 2016-10-26 11:30 +0200
Re: [PATCH v2] mm: remove unnecessary __get_user_pages_unlocked() calls Andrew Morton <akpm@linux-foundation.org> - 2016-10-27 02:20 +0200
csiph-web