Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1016675ybv; Fri, 7 Feb 2020 12:44:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwtzoBMNtx7KacEIXdcDrnwDSLiBPc8e8fnIV7CCKBW8IspuZ7Jnc2I5Deh44TYSuy4sDPa X-Received: by 2002:a05:6830:154a:: with SMTP id l10mr996483otp.44.1581108287792; Fri, 07 Feb 2020 12:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581108287; cv=none; d=google.com; s=arc-20160816; b=eaqIkQPq5MvgLKoEU6PMs+3filabuDERA3ZAbMtEtx5PTNNcjBVwvGjXs14JZ1nJym /MMajhHu/2qTC5Az3mcpEgANZzONwlvY8frdaegPV4ANL90vqIRxiaI7tkYm+UaP2pc4 S5xhMql91S4/lHeJuLpm3GDwC4ucwbDcXtaxirpLz+jOgkHqU0z0LIQYJbFQU0LyYgk4 ewnVs6vU1Le+KyBm3DWbt3Hg/8ucFxh8MzW5KK4ToFVFcjBdAPUmL7KDErsUOlXLZMpR xGVq8zHThlSPGAyRCHkSDDdd9oiFRfQ0KiZiZgwNiYgeCzi4HLZTilL4WHyAbQ6QsUsf +RkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Qme74oUO2AjF1HKgLPSJvL4CSEChV51xdiVyhj0IraY=; b=c0SZHCeNtOzrbNxO1kgGRyPjxCXrXPXBA51n7gq4xMAQVS6r8n0FbH/VFOxMc4OX7y i2frxFODUa4peRMsrJ0D4BF7F43IUwzMg9FMU79f6De9JnjiMAh3WpxTfJgXFmd/tagn JPQjoyifh7MoNyWdyBR9nD/wxFvNjFTO39Lp7abEKXicKc86CGdrTYlczmUPsyrU42Jo SS8QhNVkEXSxGGtBp37JhwA6ApgTOmEAM9gm9kx2MMx6rAp9Cfu2iX0xuksLuGTZcN/6 ZUPunKchyVi7w9uAdCEfNrRCsQriOcs79941FlgVOc4SDoksTDKJS/8Qi3pIIcLjcxc3 6ZTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bvdo489W; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si4084913oij.125.2020.02.07.12.44.35; Fri, 07 Feb 2020 12:44: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=@google.com header.s=20161025 header.b=bvdo489W; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727496AbgBGUmo (ORCPT + 99 others); Fri, 7 Feb 2020 15:42:44 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:34853 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbgBGUmn (ORCPT ); Fri, 7 Feb 2020 15:42:43 -0500 Received: by mail-ed1-f65.google.com with SMTP id f8so973702edv.2 for ; Fri, 07 Feb 2020 12:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qme74oUO2AjF1HKgLPSJvL4CSEChV51xdiVyhj0IraY=; b=bvdo489WkazsFr8MyNsmtfFBn7DsQljQXJ/HOxxSWabU4r6rIEsNpz737+aAgQboHv 1gx4Yxk1LbZYkC1W9yfgri+0wFxWOnx8qJ7BuCUbOGkyCIMgZwhZlLN8gGCOhRb/SeqT q4Y20cVFpjN7cHiDrws7RJEuz+CgdcIfo5GiOF/ezfmFqGAoj6+A4t3f2KUfZBo6LCAM TrQGLfTWFH/fwntXGaEhHmzCqCf33+HAfHS28QIf3nfNr7iKy1yp4pWofrcOB8fC5lRW CQL5fCArFohre7uLi8GcE8/5B6mcBcK87J7IAYiICzOary8Eqlj4kD4YSxN9f4yVxSKG VsUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qme74oUO2AjF1HKgLPSJvL4CSEChV51xdiVyhj0IraY=; b=YwArPAuQgNTU9+BFeddSlNFTpk6ggVN4AlN959ZCTiqxMZtD3eAmKNmCpZkpYecvSR I0bUhyF5MGuR5bV2bCjxfFJhC+2pQRH/TUcRLYqf1uY5T9R2FNutgegP+xoYm8/e3lhd 3iRAf5XtqJbH9rdML7GYzWE3S+ryAyjX3jIsrGFOrxFZrdET8wYGmxWhtIkO2us0nvGs NW15jYhHrxLn6y3xsszRvapLLrxJ+nKxP6mfuHgCiXRE2hfEy0c00qfTlmUMTdta0kX5 cPZ3w6SweCV+nIG8CSnPAjYCBJ1823dnDrdTLbiSeI/DbZ9N29btigoQIsVTnKcEnv8B V5tw== X-Gm-Message-State: APjAAAXWI1cFd+77XkouO/YfodCRkeui7tIjMhlRueKAqJHg73NSxEJY X6s6t5PMrkwvzNN1IoEz9j1HbZcqlJ0G6Fo4WuOdhw== X-Received: by 2002:aa7:d355:: with SMTP id m21mr690593edr.312.1581108161876; Fri, 07 Feb 2020 12:42:41 -0800 (PST) MIME-Version: 1.0 References: <20200123014627.71720-1-bgeffon@google.com> <20200124190625.257659-1-bgeffon@google.com> <20200126220650.i4lwljpvohpgvsi2@box> <20200129104655.egvpavc2tzozlbqe@box> <20200203130940.enfvdsbn42hhoaki@box> In-Reply-To: <20200203130940.enfvdsbn42hhoaki@box> From: Brian Geffon Date: Fri, 7 Feb 2020 12:42:15 -0800 Message-ID: Subject: Re: [PATCH v2] mm: Add MREMAP_DONTUNMAP to mremap(). To: "Kirill A. Shutemov" 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Thanks, Brian On Mon, Feb 3, 2020 at 5:09 AM Kirill A. Shutemov wrote: > > On Sun, Feb 02, 2020 at 05:17:53AM +0100, Brian Geffon wrote: > > On Wed, Jan 29, 2020 at 11:46 AM Kirill A. Shutemov > > wrote: > > > Any better options for the flag name? (I have none) > > > > The other option is that it's broken up into two new flags the first > > MREMAP_MUSTMOVE which can be used regardless of whether or not you're > > leaving the original mapping mapped. This would do exactly what it > > describes: move the mapping to a new address with or without > > MREMAP_FIXED, this keeps consistency with MAYMOVE. > > > > The second flag would be the new MREMAP_DONTUNMAP flag which requires > > MREMAP_MUSTMOVE, again with or without MREMAP_FIXED. > > > > What are your thoughts on this? > > Sounds reasonable. > > MREMAP_DONTUNMAP doesn't really convey that you move pages to the new > mapping, but leave empty mapping behind. But I guess there's only so much > you can encode into the name. (Patch to the man page should do the rest) > > -- > Kirill A. Shutemov