From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796062707; b=OaBCwDzwL6VLxl2P40ki2e8ShdnSe8ciaIbb6A9WgAlwbPgOE6V6gFLJuVCNf8VU5tbz IPEuyHcW8m0yM19UKLpuoLMUB3zfJAMl5YwUyr3fzxFAHkdr0kse81zePv9R9quWvKFr5 5ZQPwiJJh74Q7ynUo3ex5C2mq2XZ8JRL2bfL4Z5Z9DaVxB7caxwech4rM9DPjLiwj0FC9 N9MSR4KfGnIcALKiWwZwqYwAh2RbUFDAGdjQ4izauRSpVwtwDi/Ae494Z06hNW1emgpb6 pAodM9TTLJRzOtz2+m2VgiVGEb4URsiaDOyTHXck456XdWj8/vxyRE5mHkFFpuaT3GA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796062707; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=llQ1sd654RRQfImaiGrcCtwSdBoJdJfoFSrPyR4wYo8=; b=MWg7UlyVA0xS2d2HuiMFoNjguoJVIxFbxBRsTuIFuOc2yuK5zSA3zmycdF0hMd0930n9 mxLDw9Ofcsor4I8ggtxKPOh7h40iOjo62zQbaOE36fteJ/3NnOIFbnoL7QikzujR5QsJQ vVSRWqAobRJ2Ny4EnoMrLiDR+ksGdkzJj5oDmAJtRCDbxpDCNm3HnfLZpk5ErqFGHvm2/ sYL0h45b7I9t63aG+J4ypjKfAumi64nF3UyNhDBawsAFo1+GYr30NfuRBbj6wUlVyzoT5 89jDs8V4hvhydS33UJqsxBbogKK/KgWKIYHlIUY0TMQPztpPE2kkSE3yConMHgItiYg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="DAxv/KRe"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77F09606A31C; Mon, 30 Nov 2026 18:18:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DAxv/KRe Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E0851F000C1; Mon, 30 Nov 2026 18:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796062707; bh=llQ1sd654RRQfImaiGrcCtwSdBoJdJfoFSrPyR4wYo8=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=DAxv/KReleaSC5KKgTdNIujRevYsumcCuC87Bme56Z4EEInoCn8goP2ZEy4gWh7JJ M8CuBcjK9LU8COvyshPnxhsbydNOHAryaDiQKYd6ymlbMxHgQEkxsKbFj+Bff9ZotT gTirvJqQVsTUpSKRWeslWr/GFxFTBCfivGEG+ohNBFtR81gpuArIja8ZbADxRY2AVA fjAwkmjEE+nlmItnZdXEDTyXb+edOXBxw/a/lC07XsWeY9VMTHThWLQITXFHWpVH39 lX02zshpjtMQSmu5jzcQ9kg9KTAhlqLjuhuGmZkGXf7yg5axwucknV2vtkTx3jW8YS oW12zxmT3uolw== Date: Mon, 30 Nov 2026 18:18:18 +0000 From: "Lorenzo Stoakes (ARM)" To: "David Hildenbrand (Arm)" Cc: Hirotaka Yamagata , Andrew Morton , linux-api@vger.kernel.org, "Liam R. Howlett" , Chris Li , Kairui Song , Steven Rostedt , Masami Hiramatsu , Arnd Bergmann , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-arch@vger.kernel.org, cgroups@vger.kernel.org, John Stultz , Minchan Kim , Alexandre Marciano Gimenez , Tatsuyuki Ishi Subject: Re: [RFC PATCH v1 0/4] mm: port MADV_VOLATILE and MADV_NONVOLATILE to v7.3-rc1 Message-ID: References: <20261130083407.2669584-1-hiro@pisnp.net> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Nov 30, 2026 at 11:39:45AM +0100, David Hildenbrand (Arm) wrote: > On 11/30/26 09:34, Hirotaka Yamagata wrote: > > Hi, > > > This RFC series revives and modernizes the volatile ranges patchset > > originally proposed by John Stultz and Minchan Kim [1]. > > > > Volatile ranges allow userspace caches holding regenerable data (such as > > decoded image bitmaps or other private caches) to mark private anonymous > > memory as safe for the kernel to discard under memory pressure, > > bypassing swap. Such ranges are marked via madvise(MADV_VOLATILE). > > Before reusing the buffer, userspace calls madvise(MADV_NONVOLATILE), > > which unmarks the range and returns 1 if any pages in the range were > > purged while volatile (or 0 if all pages remained intact). > > We have MAP_DROPPABLE nowadays, I don't think we want more of that. Yes exactly. And also absolutely no to this pattern of: 1. Create an unnecessary new file for something 2. Redirect an MADV_xxx to that file, maybe some hooks 3. ??? 4. the control of what the MADV_xxx does sits outside of madvise now. > > > > > Unlike MADV_FREE, which silently zero-fills dropped pages on re-access, > > calling MADV_NONVOLATILE before reuse gives userspace deterministic > > notification of whether cached data was lost without having to touch > > every page. > > We do have userfaultfd missing faults + rwp (read-write-protection). Can't we > build something based on that instead? > > We currently disable uffd with MAP_DROPPABLE, but maybe there could be a use > case for it. Of course, you can also build it based on MADV_FREE instead. Well we'd need to have a compelling reason to combine the two I think :P But in general agree with - check to see what tooling there is already before making a big, invasive change to mm. -- Cheers, Lorenzo