Re: [PATCH] mm, gup: introduce concept of "foreign" get_user_pages()
From: Dave Hansen
Date: Wed Jan 20 2016 - 13:48:55 EST
On 01/20/2016 09:56 AM, Vlastimil Babka wrote:
> On 01/20/2016 06:35 PM, Dave Hansen wrote:
>> This also switches get_user_pages_(un)locked() over to be like
>> get_user_pages() and not take a tsk/mm. There is no
>> get_user_pages_foreign_(un)locked(). If someone wants that
>> behavior they just have to use "__" variant and pass in
>> FOLL_FOREIGN explicitly.
>
> Hm so this gets a bit ahead of patch "mm: add gup flag to indicate "foreign" mm
> access", right? It might be cleaner to postpone passing FOLL_FOREIGN until then,
> but not critical.
I've reworded that patch a bit, so it just talks about only enforcing
pkey permissions on non-foreign accesses. I think I'll keep
FOLL_FOREIGN in this patch because it fits in well with the other things
converted to get_user_pages_foreign().
> BTW doesn't that other patch miss passing FOLL_FOREIGN from
> get_user_pages_foreign() or something? I see it only uses it from break_ksm(),
> am I missing something?
Nope. At some point along the way, it got dropped in a merge. Thanks
for catching that! I'll include it in future versions of this patch.