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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA00EC433F5 for ; Mon, 27 Sep 2021 13:00:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D8A36103B for ; Mon, 27 Sep 2021 13:00:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4D8A36103B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C414C6B0071; Mon, 27 Sep 2021 09:00:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF13E900002; Mon, 27 Sep 2021 09:00:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADF5D6B0073; Mon, 27 Sep 2021 09:00:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id 9AFBF6B0071 for ; Mon, 27 Sep 2021 09:00:54 -0400 (EDT) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 56D6A18030458 for ; Mon, 27 Sep 2021 13:00:54 +0000 (UTC) X-FDA: 78633363228.31.88040D6 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by imf16.hostedemail.com (Postfix) with ESMTP id 0FDF9F000098 for ; Mon, 27 Sep 2021 12:59:53 +0000 (UTC) Received: by mail-pf1-f177.google.com with SMTP id g14so15817208pfm.1 for ; Mon, 27 Sep 2021 05:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hkKh8BhLSfCbj1zhtuZadMT8kTOtwFNe1ZknKGQvtw8=; b=I1rSGypxqGABhU/ICvtsq7GZCjHEkFiwxbooPx5yiZd8UHpgpsVReOOg66Xs6h/vEL pzUwX/odsC9m8alsUkvxDZvHW7cY95ZgYfFjJRksMuR0rgcE8V/sc6j3IHKu8XSHtZpk a1q6KGayEjU6YVifnhJAkXqPPOlH0q8lpuEBBEq9Ynqe68UdeObJ1bacXJc6J5BP1Zkr NMSha0t4kIAwPPNOPiXIeUZnI/NUV+q/VOmlyNrI2CCtZ5ly6MHU8v11Bek3TQb6SMuv s5p8sjkUdPA7OAG8pUJukwsa+FmhSeccAHdSqTSpc+CeFJWGQn2EOFFxtQ5KZJecgHlp xLYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=hkKh8BhLSfCbj1zhtuZadMT8kTOtwFNe1ZknKGQvtw8=; b=FCuYDbzZoTuM0UE9ggNJ3CrB/Bg4LeG00/0sCBvrgWvWyCjtMHw3UqVkIVohv3XjIm 3sx+41QQofBVsJciWbGRveLOsS398JxShRjcStceCsITcYM4M1TJwvrK85+HW650Telp +hMUKVoiSK1QoE8Y7lg+XvyYkhwXrV2MCG7vnBOJjltN4eYZRtNUMb67AanI6KJ7+gNa 4SiwaKc66Fy31+isLeL5CrS/ilBsaV23QEdYpJZiQl8HR/qfB0/E2YQxGTwwGdWbw0ax QH1ijgyi3LYckoDJXVAFtouW/2CpB/2f8IPgIzw5tAeGQxbpCL/PrK/tbz6ftEfZKBaI CJ4w== X-Gm-Message-State: AOAM533tw2Rnsi6v2uXUG4byuEWQFaDx+nBKjOidkQ4fIhT7S19GDX3q 93UBKkZliXYHhH0/GRjDZc0= X-Google-Smtp-Source: ABdhPJwrporjblo/EPRBfimIXexZclTNbr8Rc5LE+xA/OJufJu5iD1kw1ckHW8MtLSkNrlU54+nfLQ== X-Received: by 2002:a63:e408:: with SMTP id a8mr16532631pgi.184.1632747592800; Mon, 27 Sep 2021 05:59:52 -0700 (PDT) Received: from smtpclient.apple (c-24-6-216-183.hsd1.ca.comcast.net. [24.6.216.183]) by smtp.gmail.com with ESMTPSA id g8sm16583032pfv.51.2021.09.27.05.59.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Sep 2021 05:59:52 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [RFC PATCH 1/8] mm/madvise: propagate vma->vm_end changes From: Nadav Amit In-Reply-To: <20210927124518.gjas4itro5c3park@box.shutemov.name> Date: Mon, 27 Sep 2021 05:59:50 -0700 Cc: Andrew Morton , Linux-MM , Linux Kernel Mailing List , Peter Xu , Andrea Arcangeli , Minchan Kim , Colin Cross , Suren Baghdasarya , Mike Rapoport Content-Transfer-Encoding: quoted-printable Message-Id: <6496185C-6792-4D67-AF5D-E049A8DC65B8@gmail.com> References: <20210926161259.238054-1-namit@vmware.com> <20210926161259.238054-2-namit@vmware.com> <20210927090852.sc5u65ufwvfx57rl@box.shutemov.name> <20210927115507.6xfpugeg3swookbh@box> <4211F6D4-A282-4AB4-8D96-E273C5ABE0DF@gmail.com> <20210927124518.gjas4itro5c3park@box.shutemov.name> To: "Kirill A. Shutemov" X-Mailer: Apple Mail (2.3654.120.0.1.13) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=I1rSGypx; spf=pass (imf16.hostedemail.com: domain of nadav.amit@gmail.com designates 209.85.210.177 as permitted sender) smtp.mailfrom=nadav.amit@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0FDF9F000098 X-Stat-Signature: ngmpx1zkudh913mmz6kf7yte5o9fasbh X-HE-Tag: 1632747593-359503 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 Sep 27, 2021, at 5:45 AM, Kirill A. Shutemov = wrote: >=20 > On Mon, Sep 27, 2021 at 05:33:39AM -0700, Nadav Amit wrote: >>=20 >>=20 >>> On Sep 27, 2021, at 4:55 AM, Kirill A. Shutemov = wrote: >>>=20 >>> On Mon, Sep 27, 2021 at 03:11:20AM -0700, Nadav Amit wrote: >>>>=20 >>>>> On Sep 27, 2021, at 2:08 AM, Kirill A. Shutemov = wrote: >>>>>=20 >>>>> On Sun, Sep 26, 2021 at 09:12:52AM -0700, Nadav Amit wrote: >>>>>> From: Nadav Amit >>>>>>=20 >>>>>> The comment in madvise_dontneed_free() says that vma splits that = occur >>>>>> while the mmap-lock is dropped, during userfaultfd_remove(), = should be >>>>>> handled correctly, but nothing in the code indicates that it is = so: prev >>>>>> is invalidated, and do_madvise() will therefore continue to = update VMAs >>>>>> from the "obsolete" end (i.e., the one before the split). >>>>>>=20 >>=20 [snip] >> Perhaps adding this one on top of yours? I can test it when I wake = up. >> It is cleaner, but I am not sure if I am missing something. >=20 > It should work. >=20 > BTW, shouldn't we bring madvise_willneed() and madvise_remove() to the > same scheme? Even for consistency you are right. My only problem is that I am afraid to backport such a change. For MADV_DONTNEED, I saw an explicit = assumption. I can do it all in one patch if we agree that none of it goes into = stable (which I clumsily forgot to cc, but might find the patch and backport = it).=