Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* mm/memtest: the reserved-region array is reallocated inside the range under test
@ 2026-11-23 17:15 Norman Herms
  2026-12-02  7:20 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Norman Herms @ 2026-11-23 17:15 UTC (permalink / raw)
  To: Mike Rapoport; +Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org

Hi Mike,

On a board whose DRAM fails one word in every 256 bytes, memtest()
reserves every failing word on its own, 512 reservations over 1.6 MiB.
Past the 128 static entries, memblock_double_array() allocates the new
reserved array from free memory inside the range memtest() is still
reading back, and the array's own entries then fail the compare:
another 42 KiB at the top of RAM (0x1bf3c2000-0x1bf3cc800 here, inside
the tested range 0x60100000-0x1bf3cd040) is reserved as bad, in runs
of 16 bytes every 24 bytes, the size of struct memblock_region.

With memtest=4 the next pattern is written over the live array, and
the board resets during that pattern; we have not separated that from
a 16 s boot watchdog.

Coalescing nearby bad words, or reserving only after a range's verify
pass, would avoid it. Seen on 6.18.54 (arm64, Allwinner A733, 6 GiB);
mm/memtest.c is unchanged in linux-next.

Measured on my board by AI agents, analysis with an AI assistant;
a report, not a Tested-by.

Norman



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mm/memtest: the reserved-region array is reallocated inside the range under test
  2026-11-23 17:15 mm/memtest: the reserved-region array is reallocated inside the range under test Norman Herms
@ 2026-12-02  7:20 ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2026-12-02  7:20 UTC (permalink / raw)
  To: Norman Herms; +Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org

On Mon, Nov 23, 2026 at 05:15:28PM +0000, Norman Herms wrote:
> Hi Mike,
> 
> On a board whose DRAM fails one word in every 256 bytes, memtest()
> reserves every failing word on its own, 512 reservations over 1.6 MiB.
> Past the 128 static entries, memblock_double_array() allocates the new
> reserved array from free memory inside the range memtest() is still
> reading back, and the array's own entries then fail the compare:
> another 42 KiB at the top of RAM (0x1bf3c2000-0x1bf3cc800 here, inside
> the tested range 0x60100000-0x1bf3cd040) is reserved as bad, in runs
> of 16 bytes every 24 bytes, the size of struct memblock_region.
> 
> With memtest=4 the next pattern is written over the live array, and
> the board resets during that pattern; we have not separated that from
> a 16 s boot watchdog.
> 
> Coalescing nearby bad words, or reserving only after a range's verify
> pass, would avoid it.

Unfortunately neither of those solve the general case :(

Coalescing only reduces the chance that a reservation will fall onto a bad
region.

Reserving after a pass means that we need to keep the intermediate state
somewhere. If it's static array we may run out of space, if we allocate it
we're back to potentially hitting a bad range.

> Seen on 6.18.54 (arm64, Allwinner A733, 6 GiB); mm/memtest.c is unchanged
> in linux-next.
> 
> Measured on my board by AI agents, analysis with an AI assistant;
> a report, not a Tested-by.
> 
> Norman
> 

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-02  7:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 17:15 mm/memtest: the reserved-region array is reallocated inside the range under test Norman Herms
2026-12-02  7:20 ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox