From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f199.google.com (mail-wr0-f199.google.com [209.85.128.199]) by kanga.kvack.org (Postfix) with ESMTP id 79AEA6B025F for ; Fri, 8 Dec 2017 09:33:21 -0500 (EST) Received: by mail-wr0-f199.google.com with SMTP id l4so6095981wre.10 for ; Fri, 08 Dec 2017 06:33:21 -0800 (PST) Received: from smtp-out6.electric.net (smtp-out6.electric.net. [192.162.217.181]) by mx.google.com with ESMTPS id x56si897499edm.293.2017.12.08.06.33.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Dec 2017 06:33:19 -0800 (PST) From: David Laight Subject: RE: [PATCH 0/2] mm: introduce MAP_FIXED_SAFE Date: Fri, 8 Dec 2017 14:33:35 +0000 Message-ID: <0b0bd6862e3a47728c8f658c8a6b3dea@AcuMS.aculab.com> 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> <87shclh3zc.fsf@concordia.ellerman.id.au> In-Reply-To: <87shclh3zc.fsf@concordia.ellerman.id.au> Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: owner-linux-mm@kvack.org List-ID: To: 'Michael Ellerman' , Matthew Wilcox , Kees Cook Cc: Cyril Hrubis , Michal Hocko , 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 From: Michael Ellerman > Sent: 08 December 2017 11:08 ... > If we had a time machine, the right set of flags would be: >=20 > - MAP_FIXED: don't treat addr as a hint, fail if addr is not free > - MAP_REPLACE: replace an existing mapping (or force or clobber) >=20 > But the two were conflated for some reason in the current MAP_FIXED. Possibly because the original use was loading overlays? > Given we can't go back and fix it, the closest we can get is to add a > variant of MAP_FIXED which subtracts the "REPLACE" semantic. >=20 > ie: MAP_FIXED_NOREPLACE Much better than _SAFE - which is always bad because it is usually one 'safe' for one specific use case. David -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org