Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp41398pxf; Wed, 17 Mar 2021 14:49:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu9rEPsAJPip9JTxV2SmigJd39h77IyTGoH87I+tLVVS8K1/2d2GOgpKgJOtpSCaJ6Wg41 X-Received: by 2002:a05:6402:40d5:: with SMTP id z21mr45671215edb.20.1616017773205; Wed, 17 Mar 2021 14:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616017773; cv=none; d=google.com; s=arc-20160816; b=UGpPltZzItJ7CFZrRdwKszLklQjeyhqsY6Ff+4J91rqMH2gCd+QQfD9ELTzb6e0wJZ aX/1H2lyk4OCWlCypxCu9M1nlBcXMIbCU3uiT0UggoN+xb+YwwzZMSRZJEUJzjXKZFFe HlLhH6NCm1DRa9nqgvu1tzNuqb/P/UU3Yb3z+1iSlCUeaX+PMmibl7VSV0StTMc4Da6G QbqeILH5D2vdrrgM8dPg4czhnSFeY3iKQ3WYBF91XjV+Z6NE7qRgPrb2CzfdsEwMqeX2 3nkI7sJYuwvHu0vNdbptk70EPXd+XZAaNwPEvCJPMLl8Zw6+0Bq5ri3nsiwiD++hzPg5 rJOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RWcOSSbP27/RBMgQWe11X/aJCQVEZ7g4yrghOGqiUdw=; b=bxqcHgRnMSQedXLM28olSWC4vbMXS1TJgz1X595UTDxHaSKU9fpcLlnCth17qAlC2p aPWqH63vGiW1rJ/YAXPVxd+enCUIIexyWYgT6zVMiQeF5gmsq8E7IUElJ8i2nAUeEkD8 9kqh336lUWTxRichqAUIOxADOvdHJJr0gyRQnA7T1M59qM30F9HAo5cuDajLQw1ZQyfP cTMr1Ib8CMevezEbFxZEV7dSgimjuvk65p1DuCDtK/CkjdAUjlgzgEqgXQfK1xgjKzTR bufi9XRASf4MoMJpIgx6M64/6Wq5KtLYzqc5AKZ5d1iZjYdYgeKblXIG97CZGVTy+F2q n5cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=G01FSC0W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id 38si27269edr.200.2021.03.17.14.49.10; Wed, 17 Mar 2021 14:49:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=G01FSC0W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232258AbhCQV0N (ORCPT + 99 others); Wed, 17 Mar 2021 17:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbhCQVZw (ORCPT ); Wed, 17 Mar 2021 17:25:52 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C855C06174A for ; Wed, 17 Mar 2021 14:25:52 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id hq27so626516ejc.9 for ; Wed, 17 Mar 2021 14:25:52 -0700 (PDT) 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=RWcOSSbP27/RBMgQWe11X/aJCQVEZ7g4yrghOGqiUdw=; b=G01FSC0WdaRw6SoJwmrtuo3o+0nBq50lAKF0vYw+O5GLViuiT9CjymaK2TMd68YDxc akyZ3CzMGnXOn1egPwiucNYPgXcWyMBPP0RZm2lhbN9Hwigt1GoT1lDEH/T5l54wuQa+ /DOjjG2rFtESBup+N1zxrM5caaIQOPdHbhLA0B/5Y7DWzioZ/RHMYegEXM+gyBbP07v2 6HeVccbZMsVEKWhodp1rOvHQmg+c8UAWd8elENbAAmIFd1fWh99BgA6x54OtFLYHvxpM tC8S09D4O8wrWRh2zUMRMIaOcgJPma3daJOYKaFjNnWEXiMD+XwWcpgeCIRNCrmJY937 6m4w== 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=RWcOSSbP27/RBMgQWe11X/aJCQVEZ7g4yrghOGqiUdw=; b=R2lrjtHDEtk4Ajs9NOXBanMjQPK6ZkE9oqsBu5/iCKZ/Ft7mkvm8O7GNSWxgkgrkA9 THknRuCqsg5lEwC1bC1c9RqAV4rIxnBP4LIotSTAVgGQpZDvIKy/GGwGVANin0C7V7Qq xkzjCV1YRtsshk3Ew6bESc64JFxWEByCBlBzkUvRkZOPGhVGSsxhyhv+sMrlH1IPEwPz D8ozeg6hvXKyWjmftXv7OpHtAccxeXyxgArQ8DPz/4ltec71ZRISCLubNPKz7hrrgzQP Le29gURrpktfAIXhjOLG2jTOU9YGE0x7XCv7HoJfILtTPw8Faoj9+TrRNs1TS4ghKVj9 rupA== X-Gm-Message-State: AOAM5320MswD0LEZtug87iS5cMAlvTVWfCExB6W+Ym/DrXlE58SOKqTA rHWEJlQJ7eWYM+FEXyNonPCgnotAjfF/8x9JltCsSQ== X-Received: by 2002:a17:906:25c4:: with SMTP id n4mr37937861ejb.359.1616016350818; Wed, 17 Mar 2021 14:25:50 -0700 (PDT) MIME-Version: 1.0 References: <20210303175235.3308220-1-bgeffon@google.com> <20210317191334.564944-1-bgeffon@google.com> <20210317204015.GM395976@xz-x1> <20210317211857.GN395976@xz-x1> In-Reply-To: <20210317211857.GN395976@xz-x1> From: Brian Geffon Date: Wed, 17 Mar 2021 17:25:14 -0400 Message-ID: Subject: Re: [PATCH v2 1/2] mm: Allow non-VM_DONTEXPAND and VM_PFNMAP mappings with MREMAP_DONTUNMAP To: Peter Xu Cc: Andrew Morton , Axel Rasmussen , Lokesh Gidra , Mike Rapoport , Hugh Dickins , "Michael S . Tsirkin" , LKML , linux-mm , Andy Lutomirski , Vlastimil Babka , Andrea Arcangeli , Sonny Rao , Minchan Kim , "Kirill A . Shutemov" , Dmitry Safonov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org You're 100% correct, I'll mail a new patch in a few Brian On Wed, Mar 17, 2021 at 5:19 PM Peter Xu wrote: > > On Wed, Mar 17, 2021 at 04:44:25PM -0400, Brian Geffon wrote: > > Hi Peter, > > Hi, Brian, > > > Thank you as always for taking a look. This change relies on the > > existing check in vma_to_resize on line 686: > > https://elixir.bootlin.com/linux/v5.12-rc3/source/mm/mremap.c#L686 > > which returns -EFAULT when the vma is VM_DONTEXPAND or VM_PFNMAP. > > Do you mean line 676? > > https://elixir.bootlin.com/linux/v5.12-rc3/source/mm/mremap.c#L676 > > I'm not sure whether it'll work for MREMAP_DONTUNMAP, since IIUC > MREMAP_DONTUNMAP only works for the remap case with no size change, however in > that case in vma_to_resize() we'll bail out even earlier than line 676 when > checking against the size: > > https://elixir.bootlin.com/linux/v5.12-rc3/source/mm/mremap.c#L667 > > So IIUC we'll still need the change as Hugh suggested previously. > > Thanks, > > -- > Peter Xu >