From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757851AbcATSsi (ORCPT ); Wed, 20 Jan 2016 13:48:38 -0500 Received: from www.sr71.net ([198.145.64.142]:47165 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757376AbcATSsg (ORCPT ); Wed, 20 Jan 2016 13:48:36 -0500 Subject: Re: [PATCH] mm, gup: introduce concept of "foreign" get_user_pages() To: Vlastimil Babka , linux-kernel@vger.kernel.org References: <20160120173504.59300BEC@viggo.jf.intel.com> <569FCA5A.8040906@suse.cz> Cc: linux-mm@kvack.org, x86@kernel.org, dave.hansen@linux.intel.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, aarcange@redhat.com, n-horiguchi@ah.jp.nec.com, jack@suse.cz From: Dave Hansen Message-ID: <569FD681.2020808@sr71.net> Date: Wed, 20 Jan 2016 10:48:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <569FCA5A.8040906@suse.cz> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.