Re: [PATCH 3/5] hibernate: handle potential errors in hibernate_{map,unmap}_page()

From: David Hildenbrand (Arm)

Date: Thu Sep 24 2026 - 04:16:54 EST


On 9/23/26 17:42, Mike Rapoport wrote:
> On Wed, Sep 23, 2026 at 12:13:39PM +0200, David Hildenbrand (Arm) wrote:
>> On 9/17/26 08:07, Mike Rapoport (Microsoft) wrote:
>>> When safe_copy_page() had to map/unmap pages only because of
>>> debug_pagealloc() there could be no errors in the kernel page table
>>> updates.
>>>
>>> However, with the increasing desire to remove pages from the direct map
>>> this assumption becomes a real stretch.
>>
>> What's our general direction in that regard?
>>
>> I'd assume we'd not want to modify the directmap from hibernation code and
>> simply fail instead if we encounter that scenario.
>
> First I want hibernation to only touch the memory that we know is safe to
> remap, for now it's only kfence (the next patch), so no arbitrary direct
> map changes there.
>
> And if remapping fails, my take is that we should abort the hibernation.

Yes, agreed. Only handle known users and leave anything else just aborting
hibernation.

--
Cheers,

David