[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mafs0sef8e1wd.fsf@kernel.org>
Date: Fri, 24 Oct 2025 17:48:50 +0200
From: Pratyush Yadav <pratyush@...nel.org>
To: Pasha Tatashin <pasha.tatashin@...een.com>
Cc: Pratyush Yadav <pratyush@...nel.org>, Mike Rapoport <rppt@...nel.org>,
akpm@...ux-foundation.org, brauner@...nel.org, corbet@....net,
graf@...zon.com, jgg@...pe.ca, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-mm@...ck.org,
masahiroy@...nel.org, ojeda@...nel.org, rdunlap@...radead.org,
tj@...nel.org
Subject: Re: [PATCHv7 5/7] kho: don't unpreserve memory during abort
On Fri, Oct 24 2025, Pasha Tatashin wrote:
>> If any of the kho_preserve_pages() fails, the notifier block will fail,
>> cause an abort, and eventually all memory will be unpreserved.
>
> This is a wrong behavior. Why should the memory that I preserved be
> unpreserved if there is finailziation failure or abort? reserve_mem
> should still keep memory as preserved in case KHO later will be
> finalized right? I have tested that this patch works with kho
> self-test: preserve, finalize, abort, finalize again, and the pages
> are properly preserved.
>
> KHO Test and memblock do not need to ever unpreserve pages, as they
> preserve them once during boot.
Agreed. The behaviour of reserve_mem and test_kho should be fixed, patch
3 just exposes the problem.
So, for this patch
Reviewed-by: Pratyush Yadav <pratyush@...nel.org>
>
>> Now that there is no notifier, and thus no abort, the pages must be
>> unpreserved explicitly before returning.
>>
>> Similarly, for test_kho, kho_test_notifier() calls kho_preserve_folio()
>> and expects the abort to clean things up.
>>
>> Side note: test_kho also preserves folios from kho_test_save_data() and
>> doesn't clean them up on error, but that is a separate problem that this
>> series doesn't have to solve.
>>
>> I think patch 3/7 is the one that actually causes this problem since it
>
> I updated that patch with your suggested fix.
Thanks!
--
Regards,
Pratyush Yadav
Powered by blists - more mailing lists