From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1FF1C33CB1 for ; Mon, 27 Jan 2020 10:13:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A4FEB20702 for ; Mon, 27 Jan 2020 10:13:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QLwuLKdw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4FEB20702 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4375B6B0003; Mon, 27 Jan 2020 05:13:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E76D6B0006; Mon, 27 Jan 2020 05:13:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D6C86B0007; Mon, 27 Jan 2020 05:13:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id 1405A6B0003 for ; Mon, 27 Jan 2020 05:13:14 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id C5E962DFA for ; Mon, 27 Jan 2020 10:13:13 +0000 (UTC) X-FDA: 76423001466.08.plant90_9083363ae5a1d X-HE-Tag: plant90_9083363ae5a1d X-Filterd-Recvd-Size: 3306 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Mon, 27 Jan 2020 10:13:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580119992; 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=QLwuLKdwiOVRmVRFh1EXKI1Swwe1qSzqoyeFq83tMeCrxbZ4IkXo3u9gXQMhPVlUNGbslb nNHwK+i0wdBGLm1JNfStSQocZuo3XeRWAEu4sTJmLLLefFPDl0xaO14s6Hi/vINbywMx0w BZX/qMLz/nPhNhZNVc7UjwoUHWittQY= 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: * 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