Re: [PATCH v1 1/1] mm: fix race condition in the memory management

From: Hubert Mazur

Date: Thu Mar 12 2026 - 11:45:02 EST


> The prefix should be mm/execmem:
ACK, I'll change it in the next patch set.

> Does it actually happen in some environment or it's a theoretical issue?
Yes - this is reproducible on Android devices running the 6.18 kernel
during the early boot phase, when modules are loaded. The "Out of
memory" error usually hits
modules that request a lot of contiguous memory.
It may be hard to reproduce (like 5 times out of 20 probes) but it occurs.

> It's hard to parse a single huge paragraph.
ACK - I'll reformat the commit msg a bit and add an info about the
reproduction env.

> This is wrong. The caller asked for 'size' and got ALIGN(size, PMD_SIZE)
> instead.
Yeah, you're right—this is inefficient since the remaining memory from
the allocated block won't be used,
i.e. align_size - size. I'll implement the logic to return this chunk
to the free_area.

Regards