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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 35C07C35240 for ; Wed, 29 Jan 2020 10:46:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EBCB120720 for ; Wed, 29 Jan 2020 10:46:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="hBE7RzuY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBCB120720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6F97A6B0005; Wed, 29 Jan 2020 05:46:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A8846B0006; Wed, 29 Jan 2020 05:46:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 598786B0007; Wed, 29 Jan 2020 05:46:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 4112C6B0005 for ; Wed, 29 Jan 2020 05:46:52 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 06F9A82499A8 for ; Wed, 29 Jan 2020 10:46:52 +0000 (UTC) X-FDA: 76430343864.05.work22_76183524a9c4e X-HE-Tag: work22_76183524a9c4e X-Filterd-Recvd-Size: 4677 Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Wed, 29 Jan 2020 10:46:51 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id y4so17893189ljj.9 for ; Wed, 29 Jan 2020 02:46:51 -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=M2do0RgbniX1atYg9VWzRLpNfKEGIACoNc4JSMMoZc4=; b=hBE7RzuY7uEeZyYIkFZtbQ6s3E1Fl3wa0GTsgHtkEewQG138lcjbQkSJq4//crmmv5 +BMJJpv1cf6FSfhcqy+yIAzbmb1rEZm8SPkMlnLnLDkIM2ANWOm8Curm0SeeIXM/SToG 2zKW8D0I453TSQZhdRLIMecGncJc4mIycXAk/bf8tqixYRIC1umYaVBlF+dCdW/b4x91 VioTDFQsawZ4JCwiGI2J8ksSUsUQDhe7l0V9LNkjB1YrsVToN0iYOK62AktY9vEsZKCe s+jgrWbArndxjdDN5Mo0n3zFbyCSu9nWRKXFfI/JjGSsi6OjGsqCfv2cWVyzm0wzfJjw hJjQ== 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=M2do0RgbniX1atYg9VWzRLpNfKEGIACoNc4JSMMoZc4=; b=Yj1OzfisKCSI0+qrzHkHwPV5BDWUn2jxUPl5NQTVx45APx3hvjITShswPTr/ph4wmn pek+6BW8pmkmKUhKMK5vGSfogX9p+alaPDrZkZAGHEgFuL2pq2yW+Nmwf4I1HWh0o1SG hhkunVLaqP5DypL9bZ0zI/3TV1bbvuZa8vEZIFQ/51yfgWFLrYxouqnMBUnVU9pgbBjm PVdHcuL3Cq7YzJx4oq/dDQrEjdUwus57FTD7TLA4H/FY4paeUPUNY3OAc84w8STH3S5c 8jpimy4a43hGHM+GvaV6uGHKjmzzN5wX27FLPKOHb40LzPwbuVey4kK6ibCD0SoFngWP B02w== X-Gm-Message-State: APjAAAU7eaUzO9jZLr/txsVjy2VY87J+FQG0WgdYS/zUI532WXW32mlE NfqIYPPY5P9YPCnWqSQzK4OXOA== X-Google-Smtp-Source: APXvYqwGtucSvMzz57pxhsRPhvlF+l9vk6oanizkK1sgmspT6lJkLK9HpVY+p2IrTexNFgjGJ8+ExQ== X-Received: by 2002:a2e:9284:: with SMTP id d4mr15459076ljh.226.1580294809568; Wed, 29 Jan 2020 02:46:49 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id d4sm873654lfn.42.2020.01.29.02.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jan 2020 02:46:48 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id C5FD1100AFE; Wed, 29 Jan 2020 13:46:55 +0300 (+03) Date: Wed, 29 Jan 2020 13:46:55 +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: <20200129104655.egvpavc2tzozlbqe@box> References: <20200123014627.71720-1-bgeffon@google.com> <20200124190625.257659-1-bgeffon@google.com> <20200126220650.i4lwljpvohpgvsi2@box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: On Mon, Jan 27, 2020 at 05:35:40PM -0800, Brian Geffon wrote: > Hi Kirill, > Thanks for taking the time to look at this. I'll update the wording to > make it clear that MREMAP_FIXED is required with MREMAP_DONTUNMAP. I still think that chaining flags is strange. The new flag requires all existing. 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. 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) > Regarding rmap, you're completely right I'm going to roll a new patch > which will call unlink_anon_vmas() to make sure the rmap is correct, > I'll also explicitly check that the vma is anonymous and not shared > returning EINVAL if not, how does that sound? Fine, I guess. But let me see the end result. -- Kirill A. Shutemov