Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3349032ybl; Mon, 27 Jan 2020 02:16:48 -0800 (PST) X-Google-Smtp-Source: APXvYqzirPs3dyI50z/XHXNHr0ohFZtVVpRqCTnZJmGjcPSK+t0qVv9a69JY2mVXQVzq/Pbpqope X-Received: by 2002:a9d:7357:: with SMTP id l23mr11514337otk.10.1580120207965; Mon, 27 Jan 2020 02:16:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580120207; cv=none; d=google.com; s=arc-20160816; b=vD7/ByrL5TWimnXVp3Rj2gnB6e5J9jyU8i2Dl1eFkBaJaMMk/96MqYY14oapIKWLsh l/io/8zHgAdntToqX8JNfD+RozQqGAriv5bn1ok+oYkznyCn10VEsyA0GsPVT6oODHl9 ho/Rts3PT5nx8T/u/77Qk311h0+JNOqNnKM9XZjyzQtRJZcv57FrDPn4PKqMYP0uQA6T k+AI/G30Ghn+i+Hi+r/JCU/hE2sIR8JPaWIZ8eJxyWxLqU2dckBOmV3jFOVSIO+9jmsv DUqKWKYo7hT5g/u3+TQj1ejKj3N8FGNx+Ki0vBzfizBVhNUr+NDKYUX3/bVz3YJAuhEg QrEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=3eMn17RIkjhZWdXI11z/nzEmY0l83qqIsrDzFkIcHmE=; b=Hemv3+dnbvvO/rRMtwtZRGRbE4V0VuQC6gdkciGAr+HBrWWly/QBspLOcmb4r1KwsU f/1QgqDFe9lKk6s9Kh6Jnf6UgXFW/klH9jdrdRhT38v5JIpgob29LNn0/ci9qrU8bQJv yTFK+l1rqeyPwhhtBD61KImD7NDhruccxr4P7tYWZEXNDmuFQRD/W1evfpsHN9JhXylc zdzSn24rP3RLc56ZuS3d0FKB+x1S33BfajHS4W0T9FQKBknXMr/lWcwfH+StUDghZv0+ pVdgDxK7zcnwONTrcwTsM0QKHySnNIxc5Gvbra9k1QePB/i80YM9wr40HN9j9AyPn9PH OGnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Afo27jkA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h9si6519534otb.49.2020.01.27.02.16.36; Mon, 27 Jan 2020 02:16:47 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Afo27jkA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729414AbgA0KNP (ORCPT + 99 others); Mon, 27 Jan 2020 05:13:15 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:24950 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727233AbgA0KNP (ORCPT ); Mon, 27 Jan 2020 05:13:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580119994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3eMn17RIkjhZWdXI11z/nzEmY0l83qqIsrDzFkIcHmE=; b=Afo27jkAkm/KwHYbjKPWQxSy/wffIMHs2XrQagyTo/r2MBPdipd2OZ22dyGdacY6qHnZtZ JOKBOwjlvoDmOZecShrW5OANYyoJ2xgPojLCGmhkdZ24NmX2wyjLW6kUNYur7a32zD5ZAa kFQr/ClndIDnWuC1oLTB//bZr9oMu4A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-otat74i7PyeH3lWd2IHtwA-1; Mon, 27 Jan 2020 05:13:10 -0500 X-MC-Unique: otat74i7PyeH3lWd2IHtwA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CFA9107ACC7; Mon, 27 Jan 2020 10:13:08 +0000 (UTC) Received: from oldenburg2.str.redhat.com (dhcp-192-227.str.redhat.com [10.33.192.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 94D91863C0; Mon, 27 Jan 2020 10:13:03 +0000 (UTC) From: Florian Weimer To: Brian Geffon Cc: Andrew Morton , "Michael S . Tsirkin" , Arnd Bergmann , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org, Andy Lutomirski , Andrea Arcangeli , Sonny Rao , Minchan Kim , Joel Fernandes , Yu Zhao , Jesse Barnes Subject: Re: [PATCH v2] mm: Add MREMAP_DONTUNMAP to mremap(). References: <20200123014627.71720-1-bgeffon@google.com> <20200124190625.257659-1-bgeffon@google.com> Date: Mon, 27 Jan 2020 11:13:02 +0100 In-Reply-To: <20200124190625.257659-1-bgeffon@google.com> (Brian Geffon's message of "Fri, 24 Jan 2020 11:06:25 -0800") Message-ID: <87imkxxl5d.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Brian Geffon: > When remapping an anonymous, private mapping, if MREMAP_DONTUNMAP is > set, the source mapping will not be removed. Instead it will be > cleared as if a brand new anonymous, private mapping had been created > atomically as part of the mremap() call. If a userfaultfd was watching > the source, it will continue to watch the new mapping. For a mapping > that is shared or not anonymous, MREMAP_DONTUNMAP will cause the > mremap() call to fail. MREMAP_DONTUNMAP implies that MREMAP_FIXED is > also used. The final result is two equally sized VMAs where the > destination contains the PTEs of the source. What will be the protection flags of the source mapping? Will they remain unchanged? Or PROT_NONE? Thanks, Florian