Re: [linus:master] [mm, slub] 0af8489b02: kernel_BUG_at_include/linux/mm.h

From: Vlastimil Babka
Date: Tue Jan 03 2023 - 09:38:09 EST


On 1/3/23 14:46, Oliver Sang wrote:
> hi,
>
>>
>> Yet the page owner info tells us, 0x2daee was most recently used as order-1,
>> and now it seems to be (based on the raw struct page dump) sitting on a pcplist.
>>
>> So the events leading up to this could be something like:
>>
>> - 0x2daee is order-1 slab folio of the inode cache, sitting on the partial list
>> - despite being on partial list, it's freed ???
>> - somebody else allocates order-2 page 0x2daec and uses it for whatever,
>> then frees it
>> - 0x2daec is reallocated as order-1 slab from names_cache, then freed
>> - we try to allocate from the slab page 0x2daee and trip on the PageTail
>>
>> Except, the freeing of order-2 page would have reset the PageTail and
>> compound_head in 0x2daec, so this is even more complicated or involves some
>> extra race?
>
> FYI, we ran tests more up to 500 times, then saw different issues but rate is
> actually low
>
> 56d5a2b9ba85a390 0af8489b0216fa1dd83e264bef8
> ---------------- ---------------------------
> fail:runs %reproduction fail:runs
> | | |
> :500 12% 61:500 dmesg.invalid_opcode:#[##]
> :500 3% 14:500 dmesg.kernel_BUG_at_include/linux/mm.h
> :500 3% 17:500 dmesg.kernel_BUG_at_include/linux/page-flags.h
> :500 5% 26:500 dmesg.kernel_BUG_at_lib/list_debug.c
> :500 0% 2:500 dmesg.kernel_BUG_at_mm/page_alloc.c
> :500 0% 2:500 dmesg.kernel_BUG_at_mm/usercopy.c

Hm even if rate is low, the different kinds of reports could be useful to
see, if all of that is caused by the commit.

>>
>> In any case, this is something a debug_pagealloc kernel could have a chance
>> of catching earlier. Would it be possible to enable CONFIG_DEBUG_PAGEALLOC
>> and DEBUG_PAGEALLOC_ENABLE_DEFAULT additionally to the rest of the
>> configuration, and repeat the test?
>
> ok, we are starting to test by these 2 additional configs now.

Great, thanks!