Received: by 10.223.164.202 with SMTP id h10csp291538wrb; Tue, 14 Nov 2017 01:20:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMb7bDz0Jfku9IvO0OQ2vg+BrHsZIVN3HyCx+/KqMFU8PTYuy5Ham2/68ZUXeXVEgaV7ewiU X-Received: by 10.84.242.145 with SMTP id d17mr3850954pll.127.1510651245041; Tue, 14 Nov 2017 01:20:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510651244; cv=none; d=google.com; s=arc-20160816; b=EAVpvdNL3lyE4Hg2A39cftECHtk199Q031aAjq3v/bmPzEFP66C6NAIhrcZwappBiB kfMj/EhcneArrtLEtaqL5dFUnmgPdxEj9TYvV19SZh0TfB3I59Ev35g7PbSjlUcO8Fd2 +lXrceOIAo9Z49SPDympYjqXcD3pjbnarnrVXv4MJ1WnC6oTm7Bma801SisC6lYpx1Z/ mE9TeBDQktNChDTfEaDn+sb3UmoRHGiQJoEi1j/1S33Cw8jYvpQlbmYmq34iq9xfBPps mo/mhKrZFZRzKfNXsn0wvAWx4rqDikehpN/JXGU5WAWbvQ5Y+g0CwuUfKmzuzxqO8p7F /BwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=/BXFp0AgZMFqXmLvTDXOlAAo+jMBrFcuILM+/+Pf6+g=; b=xTLPQ9TgL/opRXArNG/IUC5J5EcDWY6rQBi3cGTRaOwCvNh3ht6rTOQavABgzkf5Nn HC4wTdw2aasnWR/wWbCqH/B1K+ULbGEGs7KLlqCuREX/xN4czB3qHivCL34mY1Pp8MQU etcsYeYGissy7W7Gjf9vNTQPtth55n6W6W0eSwsweAqhtVMiadkCsdgaLvVYIMX3144B zs0JxFW9zK8S+9glWOg3kkmcrMVpd4T6lYnGyjTWgJiWnzFxtXyQjaV6dWJQ/CrHf+x7 30Pg8PegClNqHz8Pgk9mLkVGNDjfZ6VfwvPmRFtYQLYMeRQ4xmxDj6pQ3geeAVlUoYHz UZMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y197si17176080pfg.162.2017.11.14.01.20.32; Tue, 14 Nov 2017 01:20:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753805AbdKNJSQ (ORCPT + 88 others); Tue, 14 Nov 2017 04:18:16 -0500 Received: from ozlabs.org ([103.22.144.67]:46507 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751466AbdKNJSH (ORCPT ); Tue, 14 Nov 2017 04:18:07 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 3ybhkP27Vkz9s9Y; Tue, 14 Nov 2017 20:18:05 +1100 (AEDT) From: Michael Ellerman To: Michal Hocko Cc: Joel Stanley , Stephen Rothwell , Andrew Morton , Linux-Next Mailing List , Linux Kernel Mailing List , Russell King , Benjamin Herrenschmidt , Abdul Haleem , Ralf Baechle , "James E.J. Bottomley" , Helge Deller , Yoshinori Sato , Rich Felker , "David S. Miller" , Chris Zankel , Max Filippov , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org Subject: Re: linux-next: Tree for Nov 7 In-Reply-To: <20171113160637.jhekbdyfpccme3be@dhcp22.suse.cz> References: <20171108142050.7w3yliulxjeco3b7@dhcp22.suse.cz> <20171110123054.5pnefm3mczsfv7bz@dhcp22.suse.cz> <20171113092006.cjw2njjukt6limvb@dhcp22.suse.cz> <20171113094203.aofz2e7kueitk55y@dhcp22.suse.cz> <87lgjawgx1.fsf@concordia.ellerman.id.au> <20171113120057.555mvrs4fjq5tyng@dhcp22.suse.cz> <20171113151641.yfqrecpcxllpn5mq@dhcp22.suse.cz> <20171113154939.6ui2fmpokpm7g4oj@dhcp22.suse.cz> <20171113160637.jhekbdyfpccme3be@dhcp22.suse.cz> Date: Tue, 14 Nov 2017 20:18:04 +1100 Message-ID: <87a7zpw75f.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michal Hocko writes: > [Sorry for spamming, this one is the last attempt hopefully] > > On Mon 13-11-17 16:49:39, Michal Hocko wrote: >> On Mon 13-11-17 16:16:41, Michal Hocko wrote: >> > On Mon 13-11-17 13:00:57, Michal Hocko wrote: >> > [...] >> > > Yes, I have mentioned that in the previous email but the amount of code >> > > would be even larger. Basically every arch which reimplements >> > > arch_get_unmapped_area would have to special case new MAP_FIXED flag to >> > > do vma lookup. >> > >> > It turned out that this might be much more easier than I thought after >> > all. It seems we can really handle that in the common code. This would >> > mean that we are exposing a new functionality to the userspace though. >> > Myabe this would be useful on its own though. Just a quick draft (not >> > even compile tested) whether this makes sense in general. I would be >> > worried about unexpected behavior when somebody set other bit without a >> > good reason and we might fail with ENOMEM for such a call now. >> >> Hmm, the bigger problem would be the backward compatibility actually. We >> would get silent corruptions which is exactly what the flag is trying >> fix. mmap flags handling really sucks. So I guess we would have to make >> the flag internal only :/ > > OK, so this one should take care of the backward compatibility while > still not touching the arch code I'm not sure I understand your worries about backward compatibility? If we add a new mmap flag which is currently unused then what is the problem? Are you worried about user code that accidentally passes that flag already? > diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h > index 203268f9231e..03c518777f83 100644 > --- a/include/uapi/asm-generic/mman-common.h > +++ b/include/uapi/asm-generic/mman-common.h > @@ -25,6 +25,8 @@ > # define MAP_UNINITIALIZED 0x0 /* Don't support this flag */ > #endif > > +#define MAP_FIXED_SAFE 0x2000000 /* MAP_FIXED which doesn't unmap underlying mapping */ > + As I said in my other mail I think this should be a modifier to MAP_FIXED. That way all the existing code that checks for MAP_FIXED (in the kernel) works exactly as it currently does - like the check Khalid pointed out. And I think MAP_NO_CLOBBER would be a better name. cheers From 1584031832000569643@xxx Tue Nov 14 09:07:54 +0000 2017 X-GM-THRID: 1583423641769727671 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread