Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3580141ybv; Mon, 10 Feb 2020 02:36:15 -0800 (PST) X-Google-Smtp-Source: APXvYqyf5oN324apRBN/bWFZ9F6wNxvhOAhtzAYTqSexB4mVR1vHIzyEZ+zSRvExjHqwq26BGqKr X-Received: by 2002:a9d:6647:: with SMTP id q7mr571124otm.35.1581330975712; Mon, 10 Feb 2020 02:36:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581330975; cv=none; d=google.com; s=arc-20160816; b=CbSRTwZo5oH2RHZc3vAXAPwtmCop6FanM3tDiQOyfG+uXS8WUJn2re+nMJNIKBBPMM 3VXuiQWSqrMruBRWE1zSMxxWUqXJMC1riCX0LePmeyy16cCYDzicIbwEaXox/7PC9yQO nSyJRnck+EJii32LWnmqVnMMgEHaPnd/fMUG2df8EwaMoeuzqX4uTjMIiOABgLeRV8gJ bLDKPIux/pPsY95fivd1KnM3eiTOERhnS4gT+cFAcrHwJyPOO+sq5OVSWk6B2ci3Qhk3 9wcNORXSNmETexT3+pZZOJdvXStcS5fiXU6u5nPu7zwOLQJ/5iKVWBGsUEat65zRk2zD YCvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gBA2mpqc5yNuBwQF0S/7vQMG1htEwiZgSuMMRsfYXAs=; b=gkorp/a4gAXwaHW/IvdVpTvDmjXuGuIbTF5eyFKgqgxVnQVlGzVDTu2Otp4n5P9qqu Xi8Hgv4US5Gm/mpXqDOLfAkqoKHCuBm9xJe+kRn6AXsHgffi/mMd+mHSJivELUJuCQDA qnzKz9KOug0lsmETMMN98lQz9/UjxM1DMCvfk53UEZ4y/+xK/iOmAKxmnJFUm3gFDll7 51nYUH/cavRNkvlWRDiXVgfgIx/QRHzsnbaLHX8YgRK55TuuqFbLqA2C7CGKLH9zDbAV yFdvcRSNElnOcVmgMiSrtxe21J1t6UEvGij2q0YISGdKdOBfK7/TSoCjZDNI8nTtrIQT pUrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=rSwTITTB; 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 l4si5720oib.170.2020.02.10.02.36.03; Mon, 10 Feb 2020 02:36:15 -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=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=rSwTITTB; 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 S1727369AbgBJKfl (ORCPT + 99 others); Mon, 10 Feb 2020 05:35:41 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45796 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbgBJKfl (ORCPT ); Mon, 10 Feb 2020 05:35:41 -0500 Received: by mail-lj1-f193.google.com with SMTP id f25so6489192ljg.12 for ; Mon, 10 Feb 2020 02:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gBA2mpqc5yNuBwQF0S/7vQMG1htEwiZgSuMMRsfYXAs=; b=rSwTITTB+2r28n2Butgc7Bsjdj50BTP4ffGx1My9Imv9wCXcLjgtbxkcwJVYTU95Ef XaMMMNinTsqW5qDSvh1u3a16YuEDuFSGP9OzOn8c7yz5ryA7b5UCHRmLQlAKS6mjOUTi RN2JoND+a3Oc451cl65w+eSeo3j7CECjTGa70SgqaV2bV1IM4wBNN3h0PJJM28mi66a6 jSn6txrRpKv72mBZJYUgWIpAJ7mdothPRIiA9ZdgsI2jFewnRyY/ZO1VUiO7A+sYQ7cv wo3vIpKcUXJoQ7XNxryqC6kYFRbgPESx8Yx4E8CswvMVNdwnjdVEoy+dPN0srbtCY5Nk nXig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gBA2mpqc5yNuBwQF0S/7vQMG1htEwiZgSuMMRsfYXAs=; b=a0ROn2Ze5gV9J9ga5Rd0ZgIXmZTxokkocHQxMBThYehuVZ7WpQlhzJZvXSna6m9ic3 VivxRyFaHx5Ug7oO5nJ2LL28FZitXgkQZOutRkCG+rD1U+DcDDzPMaYHptKHirid0OIm b3d6n+uTk05377ETHyy4Ve2wZuxbmoa6vsklpz1OO/ATDcflNA8ISsZnjeSzTPc2bWS4 zHyswmOQY1bBBjTbkpZaZJ52YlluYMtK91YWBtsVa1NET6QSOmybXKLS+KWlvPkx8AAZ X8Zk/EvpumXHYd1Q/H+ePrht13uoQsaY87l66ibzKIv+B7QY+lkZSBzNW2oStmI3qUCW IbTw== X-Gm-Message-State: APjAAAUSOqPyLQ5rfGeUosDRuicMsVXdE+SjBXRKppO97Lsz3X5XuwUr Pg2WG7lcUUdETM3Uu7WdxSC/kg== X-Received: by 2002:a2e:9d92:: with SMTP id c18mr494979ljj.265.1581330939239; Mon, 10 Feb 2020 02:35:39 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id m24sm7474324ljb.81.2020.02.10.02.35.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2020 02:35:38 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id E79D4100B0A; Mon, 10 Feb 2020 13:35:56 +0300 (+03) Date: Mon, 10 Feb 2020 13:35:56 +0300 From: "Kirill A. Shutemov" 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(). Message-ID: <20200210103556.wz72op4g554qn5jm@box> References: <20200123014627.71720-1-bgeffon@google.com> <20200124190625.257659-1-bgeffon@google.com> <20200126220650.i4lwljpvohpgvsi2@box> <20200129104655.egvpavc2tzozlbqe@box> <20200203130940.enfvdsbn42hhoaki@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 07, 2020 at 12:42:15PM -0800, Brian Geffon wrote: > Hi Kirill, > I started a new thread https://lkml.org/lkml/2020/2/7/640 for my v4 > patch. But I wanted to quickly address your comments. Regarding the > concern around the rmap, no changes actually need to be made. If we > were to unlink_anon_vma(vma) and then set vma->anon_vma = NULL, that > would be fine but then as soon as there was a fault the same anon_vma > would be attached since it's a private anonymous mapping. So there is > really nothing to do regarding the rmap. Okay. My worry was that we create a new VMA with the same anon_vma *and* vm_pgoff, but I just realized we can do the same with the current mremap(2) plus following mmap(2) in the old place. So it's not regression. I guess we are fine here. > I considered the two flag approach but since I could not come up with > a concrete use case of MREMAP_MUSTMOVE I decided to just leave the > single MREMAP_DONTUNMAP flag, the two flag approach would be only for > clarifying the operations so I'm not sure it's worth it. (Still trying > to come up with a better name). But I've attached a man page diff to > the latest patch. At least it doesn't have 'FIXED' semantics forced on user. It's fine with me. -- Kirill A. Shutemov