[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d67e9c8c-fa82-3ce4-1894-f2ad1779d834@redhat.com>
Date: Fri, 4 Mar 2022 14:08:57 +0100
From: David Hildenbrand <david@...hat.com>
To: Johannes Weiner <hannes@...xchg.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Michal Hocko <mhocko@...e.com>, Vlastimil Babka <vbabka@...e.cz>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
"dgilbert@...hat.com" <dgilbert@...hat.com>
Subject: Re: [PATCH] mm: madvise: MADV_DONTNEED_LOCKED
On 03.03.22 22:47, Johannes Weiner wrote:
> On Thu, Mar 03, 2022 at 04:29:56PM -0500, Johannes Weiner wrote:
>> MADV_DONTNEED historically rejects mlocked ranges, but with
>> MLOCK_ONFAULT and MCL_ONFAULT allowing to mlock without populating,
>> there are valid use cases for depopulating locked ranges as well.
Indeed, there are. I'd have use for that in QEMU for virtio-mem (which
uses MADV_POPULATE_WRITE+MADV_DONTNEED to dynamically allocate/discard
memory in a sparse memory mapping to be used by the VM, currently
doesn't support mlock for obvious reasons).
Further, QEMU postcopy live migration handling requires an munlockall()
before registering the uffd handler and discarding all RAM via
MADV_DONTNEED. Once postcopy finished, we have to mlock() again. I
didn't check if there would be more stopping uffd from working on a
mlocked region, but this would be one piece of the puzzle I guess.
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists