From mboxrd@z Thu Jan 1 00:00:00 1970 From: Edward Napierala Subject: Re: [PATCH v2 0/2] mm: introduce MAP_FIXED_SAFE Date: Thu, 14 Dec 2017 12:44:17 +0000 Message-ID: References: <20171213092550.2774-1-mhocko@kernel.org> <20171213163210.6a16ccf8753b74a6982ef5b6@linux-foundation.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11458e22081e6a05604c3e56" Return-path: In-Reply-To: <20171213163210.6a16ccf8753b74a6982ef5b6@linux-foundation.org> Sender: owner-linux-mm@kvack.org To: Andrew Morton Cc: Michal Hocko , linux-api@vger.kernel.org, Khalid Aziz , Michael Ellerman , Russell King - ARM Linux , Andrea Arcangeli , linux-mm@kvack.org, LKML , linux-arch@vger.kernel.org, Florian Weimer , John Hubbard , Matthew Wilcox , Abdul Haleem , Joel Stanley , Kees Cook , Michal Hocko , jasone@google.com, davidtgoldblatt@gmail.com List-Id: linux-api@vger.kernel.org --001a11458e22081e6a05604c3e56 Content-Type: text/plain; charset="UTF-8" Regarding the name - how about adopting MAP_EXCL? It was introduced in FreeBSD, and seems to do exactly this; quoting mmap(2): MAP_FIXED Do not permit the system to select a different address than the one specified. If the specified address cannot be used, mmap() will fail. If MAP_FIXED is specified, addr must be a multiple of the page size. If MAP_EXCL is not specified, a successful MAP_FIXED request replaces any previous mappings for the process' pages in the range from addr to addr + len. In contrast, if MAP_EXCL is specified, the request will fail if a mapping already exists within the range. --001a11458e22081e6a05604c3e56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+UmVnYXJkaW5nIHRoZSBuYW1lIC0gaG93IGFib3V0IGFkb3B0aW5nIE1B UF9FWENMP8KgIEl0IHdhcyBpbnRyb2R1Y2VkIGluIEZyZWVCU0QsPGRpdj5hbmQgc2VlbXMgdG8g ZG8gZXhhY3RseSB0aGlzOyBxdW90aW5nIG1tYXAoMik6PC9kaXY+PGRpdj48YnI+PC9kaXY+PGRp dj5NQVBfRklYRUQg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qAgwqAgwqAgwqAgwqAgwqAgwqAg wqAgwqAgwqAgwqAgwqAgd2lsbCBmYWlsIGlmIGEgbWFwcGluZyBhbHJlYWR5IGV4aXN0cyB3aXRo aW4gdGhlPC9kaXY+PGRpdj7CoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCByYW5n ZS48L2Rpdj48L2Rpdj48ZGl2Pjxicj48L2Rpdj48L2Rpdj4NCg== --001a11458e22081e6a05604c3e56-- -- 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