[PATCH v6 5/7] drivers/base/memory: count the poison a block already holds when creating it

sashiko-bot at kernel.org sashiko-bot at kernel.org
Fri Oct 16 05:30:15 PDT 2026


> A frame flagged poisoned before memory_dev_init() runs cannot be counted
> on its memory block. memblk_nr_poison_inc() divides by sections_per_block,
> which memory_dev_init() sets, and the block does not exist yet. The block
> is then created reading zero, however many of its frames are poisoned.
> 
> Until now nothing could poison a frame that early. It becomes possible
> once a kernel flags the frames it inherits from the one that kexeced into
> it, as it initializes its memmap.
> 
> memory_block_online() refuses a block that holds a poisoned frame, and a
> counter stuck at zero lets one through.
> 
> Count what a block holds when it is created at boot. The walk sits behind
> num_poisoned_pages, so a machine with no poison does not pay for it.
> 
> Signed-off-by: Breno Leitao <leitao at debian.org>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-hwpoison-kho-v6-0-f304255147da@debian.org?part=5




More information about the kexec mailing list