Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752316AbcJJI2d (ORCPT ); Mon, 10 Oct 2016 04:28:33 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:33786 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbcJJI2b (ORCPT ); Mon, 10 Oct 2016 04:28:31 -0400 Date: Mon, 10 Oct 2016 09:28:28 +0100 From: Lorenzo Stoakes To: Jan Kara Cc: Hugh Dickins , Linus Torvalds , Dave Hansen , Rik van Riel , linux-mm , Mel Gorman , tbsaunde@tbsaunde.org, robert@ocallahan.org, Linux Kernel Mailing List , Andrew Morton Subject: Re: [PATCH] mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing Message-ID: <20161010082828.GA13595@lucifer> References: <20160911225425.10388-1-lstoakes@gmail.com> <20160925184731.GA20480@lucifer> <1474842875.17726.38.camel@redhat.com> <20161007100720.GA14859@lucifer> <20161007162240.GA14350@lucifer> <20161010074712.GB24081@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161010074712.GB24081@quack2.suse.cz> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1019 Lines: 20 On Mon, Oct 10, 2016 at 09:47:12AM +0200, Jan Kara wrote: > Yeah, so my cleanups where mostly concerned about mmap_sem locking and > reducing number of places which cared about those. Regarding flags for > get_user_pages() / get_vaddr_frames(), I agree that using flags argument > as Linus suggests will make it easier to see what the callers actually > want. So I'm for that. Great, thanks Jan! I have a draft patch that needs a little tweaking/further testing but isn't too far off. One thing I am wondering about is whether functions that have write/force parameters replaced with gup_flags should mask against (FOLL_WRITE | FOLL_FORCE) to prevent callers from doing unexpected things with other FOLL_* flags? I'm inclined _not_ to because it adds a rather non-obvious restriction on this parameter, reduces clarity about which flags are actually being used (which is the point of the patch in the first place), and the caller ought to know what they are doing. I'd be curious to hear people's thoughts on this.