Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2082627ybl; Sat, 1 Feb 2020 13:06:04 -0800 (PST) X-Google-Smtp-Source: APXvYqwAygba3cSOlZlv6Zh4ElZEln2tfQl7UpCArxaScI0ieNyTzg+R942AlT5wPfFfVVxAFt4Z X-Received: by 2002:a9d:590d:: with SMTP id t13mr12804565oth.290.1580591164010; Sat, 01 Feb 2020 13:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580591163; cv=none; d=google.com; s=arc-20160816; b=S9g9BVYnFefjhvLeRJ1Blq3mTvut1uHVaNI8n6k4Up/xs1TkZSj6tUVHnKeXTIwlAz Y3/48/nfkL8YibfT7x2qbxSussbovIlBqQJiZ/wCfV1ngz5ZCSAYdIdDUyf8dooCr4sj xWmrnuRGQ5OovoVOdCDSBIQMD3Uo65BZw99GyMs+oY3eIlHSBTtgz8xThICgGYmXwB8i cIMFt+xH5jABI70BXazvUkXvUciYmTI8+FNodYZHzWNWZACvXQLpyVXSjmsy7Zdq51ZU duUESiyugkhlmq7HWO2uUU5Yfeo0WK6U6x/4wwPrOqRMVCbcOhNzq11zxTAVzHcdRJPF /LOg== 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=+5xWGlvNfGW6R2a9oEMXO5Vtc+knDhZupxtbrwKUTXo=; b=dnr4Kq7J2YqZQAM93VyOQcsB3wEyc756N59P9T5vzXl12OK3Ok9+aJvqO0H4bj78RJ FMFwrcj6TZ9CVl4ln1aGR6MXt3IoW08Sz7wupOzhROV53S9ZBmWeuqggpRVX7s3FjMET AJ/e1RUPl974ybbCAIAyPIeMRqHaLJKe/gBZmRqOx4XXkmFJY4ZOwgh8D1NPvvK38Nxm VebdPi6dOLwsqhLSs92CsrEuEk2+S/xas56u0uzpFwciBy123PuUHC2BGU6L4hTU4A18 JDxsObqNdQZPFXuP2kIpdFtf33n5AqU29SUNkts0yfrrAOBh97nGFfrvjPT5sCms6Xt4 BwZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=bcQ8FHSY; 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 x20si6839208otq.222.2020.02.01.13.05.40; Sat, 01 Feb 2020 13:06:03 -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=bcQ8FHSY; 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 S1726643AbgBAVEF (ORCPT + 99 others); Sat, 1 Feb 2020 16:04:05 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42952 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726453AbgBAVEF (ORCPT ); Sat, 1 Feb 2020 16:04:05 -0500 Received: by mail-ed1-f67.google.com with SMTP id e10so11761471edv.9 for ; Sat, 01 Feb 2020 13:04:04 -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=+5xWGlvNfGW6R2a9oEMXO5Vtc+knDhZupxtbrwKUTXo=; b=bcQ8FHSYBBwSb81QiCF/CKbYbzpf1tXxm8vOpxbJAF12nriUjGMwkVIFbp0mq+2rZG 7ruF44t2Z0ZSJLH2D/5kxkD17Zv66LgSg4AT4ERgBhAcALe4zS9ENkDobSB5jFoGejpC pQaI3ZXFRujxGKy665W4vaewcvoTNCGXu5WiO5DNXBDrHJj3QCyHYMVbfAkDLwa+/ENY kiFMORLakKwn7OrqDVWnjKtbwqeKx9W4jVQJiwmND89XzgFMJnztVcVqAx+mOUvXUgvp shvkhry3P/mJdC6lcxeQVqFmzSGh6vfViT5i8wIg1CbwMM5Na8ih7Ei5050pBuPCb3fw BsKg== 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=+5xWGlvNfGW6R2a9oEMXO5Vtc+knDhZupxtbrwKUTXo=; b=H7AkzEMADw3Fxrgq5ofdTwraxwTLRYwF2ZgjHK6frMy/hGXM9NgzYkygibS3Dw9fa1 /ovhx8ip9AM0giQgtScy5L9nHOSorNteS1JQyiQ6pDS/iSmHmmwDCMSYPHZIflOBAnAs yLO3r6piWJiysHjEX9yS8kpECaMrdH7hPkUoBC8/uYj9hWbMw8iBz+hiUaMUsGXp0xtO Wfg3lcvEZVHrmHjQh4c3nRhEdApHkoPTECXb7IQBgKqTk9vBcMXV2W7mRiDCtIuMneDR MyBjzfhdPX3iCg6Zbr/LZ4fjLxBfAYba9fWFqFsSILPHMNY7Sb3oibw079wA8EuT7enP 2J/g== X-Gm-Message-State: APjAAAVyp5O7VH0oJ9/sW9UAvP6rDsotb5SGXWR+U97mJLiqSlyxcL5J Ja9+N4i5JrF3vchx4f+X94R6JzjldrE1cwxLjAVNqQ== X-Received: by 2002:a05:6402:2037:: with SMTP id ay23mr5935349edb.146.1580591043082; Sat, 01 Feb 2020 13:04:03 -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> In-Reply-To: <20200129104655.egvpavc2tzozlbqe@box> From: Brian Geffon Date: Sat, 1 Feb 2020 22:03:37 +0100 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, On Wed, Jan 29, 2020 at 11:46 AM Kirill A. Shutemov wrote: > And based on the use case you probably don't really need 'fixed' > semantics all the time. The user should be fine with moving the mapping > *somewhere*, not neccessary to the given address This is true and and it simplifies things a bit as for the outlined use cases the user would not be required to mmap the destination before hand. Part of the reason I chose to require MREMAP_FIXED was because mremap need not move the mapping if it can shrink/grow in place and it seemed a bit awkward to have "MUSTMOVE" behavior without MAP_FIXED. I'll make this change to drop the requirement on MREMAP_FIXED in my next patch. > BTW, name of the flag is confusing. My initial reaction was that it is > variant of MREMAP_FIXED that does't anything at the target address. > Like MAP_FIXED vs. MAP_FIXED_NOREPLACE. > > Any better options for the flag name? (I have none) I see your point. Perhaps MREMAP_MOVEPAGES or MREMAP_KEEP_SOURCE? I struggle to come up with a single name that encapsulates this behavior but I'll try to think of other ideas before I mail the next patch. Given that we will drop the requirement on MREMAP_FIXED, perhaps MOVEPAGES is the better option as it captures that the mapping WILL be moved? Thanks again for taking the time to look at this. Best, Brian