Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752764AbdLHIdV (ORCPT ); Fri, 8 Dec 2017 03:33:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:37425 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751149AbdLHIdS (ORCPT ); Fri, 8 Dec 2017 03:33:18 -0500 Date: Fri, 8 Dec 2017 09:33:15 +0100 From: Michal Hocko To: Matthew Wilcox Cc: Kees Cook , Michael Ellerman , Cyril Hrubis , Linux API , Khalid Aziz , Andrew Morton , Russell King - ARM Linux , Andrea Arcangeli , Linux-MM , LKML , linux-arch , Florian Weimer , John Hubbard , Abdul Haleem , Joel Stanley , Pavel Machek Subject: Re: [PATCH 0/2] mm: introduce MAP_FIXED_SAFE Message-ID: <20171208083315.GR20234@dhcp22.suse.cz> References: <20171129144219.22867-1-mhocko@kernel.org> <20171130065835.dbw4ajh5q5whikhf@dhcp22.suse.cz> <20171201152640.GA3765@rei> <87wp20e9wf.fsf@concordia.ellerman.id.au> <20171206045433.GQ26021@bombadil.infradead.org> <20171206070355.GA32044@bombadil.infradead.org> <87bmjbks4c.fsf@concordia.ellerman.id.au> <20171207195727.GA26792@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171207195727.GA26792@bombadil.infradead.org> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2009 Lines: 62 On Thu 07-12-17 11:57:27, Matthew Wilcox wrote: > On Thu, Dec 07, 2017 at 11:14:27AM -0800, Kees Cook wrote: > > On Wed, Dec 6, 2017 at 9:46 PM, Michael Ellerman wrote: > > > Matthew Wilcox writes: > > >> So, just like we currently say "exactly one of MAP_SHARED or MAP_PRIVATE", > > >> we could add a new paragraph saying "at most one of MAP_FIXED or > > >> MAP_REQUIRED" and "any of the following values". > > > > > > MAP_REQUIRED doesn't immediately grab me, but I don't actively dislike > > > it either :) > > > > > > What about MAP_AT_ADDR ? > > > > > > It's short, and says what it does on the tin. The first argument to mmap > > > is actually called "addr" too. > > > > "FIXED" is supposed to do this too. > > > > Pavel suggested: > > > > MAP_ADD_FIXED > > > > (which is different from "use fixed", and describes why it would fail: > > can't add since it already exists.) > > > > Perhaps "MAP_FIXED_NEW"? > > > > There has been a request to drop "FIXED" from the name, so these: > > > > MAP_FIXED_NOCLOBBER > > MAP_FIXED_NOREPLACE > > MAP_FIXED_ADD > > MAP_FIXED_NEW > > > > Could be: > > > > MAP_NOCLOBBER > > MAP_NOREPLACE > > MAP_ADD > > MAP_NEW > > > > and we still have the unloved, but acceptable: > > > > MAP_REQUIRED > > > > My vote is still for "NOREPLACE" or "NOCLOBBER" since it's very > > specific, though "NEW" is pretty clear too. > > How about MAP_NOFORCE? OK, this doesn't seem to lead to anywhere. The more this is discussed the more names we are getting. So you know what? I will resubmit and keep my original name. If somebody really hates it then feel free to nack the patch and push alternative and gain concensus on it. I will keep MAP_FIXED_SAFE because it is an alternative to MAP_FIXED so having that in the name is _useful_ for everybody familiar with MAP_FIXED already. And _SAFE suffix tells that the operation doesn't cause any silent memory corruptions or other unexpected side effects. -- Michal Hocko SUSE Labs