Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1689377ybl; Thu, 30 Jan 2020 04:21:40 -0800 (PST) X-Google-Smtp-Source: APXvYqx/ce6h1t/+L7BJ8ZLVepGLMKxKm2GHmSMAj0OO6xLePYh/GEUpuLOhg+vEnSaxdgYY126X X-Received: by 2002:a05:6830:1d5b:: with SMTP id p27mr3130681oth.263.1580386900001; Thu, 30 Jan 2020 04:21:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580386899; cv=none; d=google.com; s=arc-20160816; b=mrREmL6PiQnjbtW7P046cHGOQa5Dhcj5Dj9qJWpEy+sU7IHMh7CpksoxaMk/bG2qmg nUrOokNiTMufcOFpMRuIGFC/LIOddZJ50geFwGQML5tA8rJcuCiXDZFL/XkW1I1eMO4B coAnKFz3txjPx2yYfyh5YcNvOHQx1x48KoUBVFpMdWNL5PFwinbLX86cPxY2RKJVhEv3 V3CuqdEx2WY8RmzEgzPZ0SAwB2Pje3R3uTesUzsVkNc78DpWOtRDcoGr7YTFgGBX+xRv qsJ+xopxD/BiIpv8vzehgGbx4+n23/5fiBSb96XLxi6NQH/+crRQ9y3Oi5kE0JgvA11a f6oA== 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=6Xqdu8J6TOj9He6qQ+BqrK7qHeGQ1dIibFBQ/FqCh1s=; b=C45pky/90O6jmix4eobbZTipR4LopNhOoNyv2AFDCMMVkGpsogYLiiaKFf8gOj6HOW XYAfLtZ/rJzgvPyWh+ogoEsx7zE/rJy4XbLUqccSmVJHjTPvr7yxebkI2u/rTv/7yX/n rRSpKjRKjDucVM5VwlYnghdaq/SpTIOh7hod9fRW+JA1putoK6buvHFxFO+XBaT4L5jn BqivQzBsWwRi5UsQPuuFs+tkm6FgW6LEdX8CJv7j7nV7dLswKB5pWaoxJ+dZCWu8nrRB Ebv3py0kasuD4PoxqDpr4hpmMi5qgXotqJxcvr8R5BN8mAOqSsK9QLs67g+ckGIh8xZ2 65vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D0WwOnHP; 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 k13si2641235oij.118.2020.01.30.04.21.28; Thu, 30 Jan 2020 04:21:39 -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=D0WwOnHP; 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 S1727199AbgA3MT6 (ORCPT + 99 others); Thu, 30 Jan 2020 07:19:58 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:39974 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726873AbgA3MT6 (ORCPT ); Thu, 30 Jan 2020 07:19:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580386797; 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=6Xqdu8J6TOj9He6qQ+BqrK7qHeGQ1dIibFBQ/FqCh1s=; b=D0WwOnHP24mRjhrfcRwZYM+JuqHTBH2t/xypTKgVP3o030xg1EGGmN39SeW9n8VZs41+O9 +SVxUvhqbEPPAheL58Xwx2LORq17Cyd8oPxZaP6bHgISL7lVXbk71LCIIsvsRl2nsgCOoP LPC675ERSwQ3tmADIwyScp/fvCorzIw= 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-23-n6jIJxsQONivvhbjyMM1Ng-1; Thu, 30 Jan 2020 07:19:51 -0500 X-MC-Unique: n6jIJxsQONivvhbjyMM1Ng-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 94C6D8010EE; Thu, 30 Jan 2020 12:19:49 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 967175DA75; Thu, 30 Jan 2020 12:19:41 +0000 (UTC) From: Florian Weimer To: Brian Geffon Cc: Andrew Morton , "Michael S . Tsirkin" , Arnd Bergmann , LKML , linux-mm , 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> <87imkxxl5d.fsf@oldenburg2.str.redhat.com> Date: Thu, 30 Jan 2020 13:19:39 +0100 In-Reply-To: (Brian Geffon's message of "Mon, 27 Jan 2020 14:33:44 -0800") Message-ID: <87eevh3zms.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.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Brian Geffon: > Hi Florian, > copy_vma will make a copy of the existing VMA leaving the old VMA > unchanged, so the source keeps its existing protections, this is what > makes it very useful along with userfaultfd. I see. On the other hand, it's impossible to get the PROT_NONE behavior by a subsequent mprotect call because the mremap has to fail in some cases in vm.overcommit_memory=2 mode. But maybe that other behavior can be provided with a different flag if it turns out to be useful in the future. Thanks, Florian