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=-8.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 A40F3C35246 for ; Sat, 1 Feb 2020 21:04:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4055520679 for ; Sat, 1 Feb 2020 21:04:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="bcQ8FHSY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4055520679 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9E5C76B061A; Sat, 1 Feb 2020 16:04:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 96E3B6B061B; Sat, 1 Feb 2020 16:04:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 835D76B061C; Sat, 1 Feb 2020 16:04:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0080.hostedemail.com [216.40.44.80]) by kanga.kvack.org (Postfix) with ESMTP id 6AD186B061A for ; Sat, 1 Feb 2020 16:04:05 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 153F4181AEF10 for ; Sat, 1 Feb 2020 21:04:05 +0000 (UTC) X-FDA: 76442785650.17.cup79_68179922ff27 X-HE-Tag: cup79_68179922ff27 X-Filterd-Recvd-Size: 4565 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Sat, 1 Feb 2020 21:04:04 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id f8so11822538edv.2 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=WvtJyL+E23NWuCIAUSx0gGCdgUmm2aCt2CD5Ely0PXHvjmmMTCdqaMem0CrNjXJXFk qglKhAFEZMmI0O6nJoAt2B4XAfXzxKSEDLpnavTxvza88QxPIehzf5hk8F7wNZlys1Bf fYl0CFZ/EB2Ay3H2/56bfrjwxN2HMWS6jv2rrDCZS8zHCqW2XbmkaIb/H3MaOYOOgBB5 fMVNNhRUuY5L18rPhq3vXk36sbyhKnE89v7MzWmmcR/ypnHhrA8WpimybE+pwqQwazIw duej6JDB2l+BK7s5Le3NPYq1fCt7954vfcT5LWSm6PjEOwS66UsYatpYPBU2p6uoTAKJ hRCA== X-Gm-Message-State: APjAAAV5Uwgsq4vAySMIA80K/zOqhmLwAXCQ4U4wGou//i0c9+oF0535 d/2uhOBNZl4cQpobt++r6aElrkSjOqlEZQ9KLlfkUQ== X-Google-Smtp-Source: APXvYqyeuHjcmV/Xzo4whsXR8bzA6nBXfklcpdG29SfmnlxREzB00zSM/PJfdcDHg+A5M772ODl1DKNwwX3tVsLcNjg= 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" 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: 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