On Tue, May 12, 2026 at 06:36:08PM +1200, Tao Liu wrote:
On Thu, May 7, 2026 at 11:40 PM Huang Shijie <huangsj(a)hygon.cn>
wrote:
>
> We may meet a large folio at two cases:
> 1.) when height is 1, the real data layout may looks like this:
> --------------------------------------------
> crash> p *(struct xa_node*)0xffff889883a6a910
> $5 = {
> shift = 0 '\000',
> offset = 0 '\000',
> count = 64 '@',
> nr_values = 0 '\000',
> .................
> slots = { 0xffffea0061d21000, 0x2, 0x2, 0x2,
> 0xffffea0121d85c00, 0x12, 0x12, 0x12,
> 0xffffea0121d9f400, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22,
0x22,
> 0xffffea0121583800, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
0x42,
> 0xffffea0121833e00, 0x62, 0x62, 0x62, 0x62, 0x62, 0x62,
0x62,
> 0xffffea0121eb3800, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
0x82,
> 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
0x82,
> 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
0x82,
> 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
0x82,
> 0x82, 0x82, 0x82
> },
> .................
> }
> --------------------------------------------
> The page orders for above folios:
> 0xffffea0061d21000 --> order 2
> 0xffffea0121d85c00 --> order 2
> 0xffffea0121d9f400 --> order 3
> 0xffffea0121583800 --> order 3
> 0xffffea0121833e00 --> order 3
> 0xffffea0121eb3800 --> order 5
>
> 2.) when height is not 1, the real data layout may looks like this:
> --------------------------------------------
> slot: { 0xffff8a2c866b745a, 0xffff8a2c866b16d2, 0xfffff9fcc4ea4000,
0xfffff9fcc4eb9000, ..}
> --------------------------------------------
> The 0xffff8a2c866b745a and 0xffff8a2c866b16d2 is a internal node, not a folio.
Don't we need to iterate into the internal node in order to find their
leaf nodes?
Yes, we should iterate into the internal node.
I keep this sentence here to describe the different types in the layer.
> The page orders for above folios:
> 0xfffff9fcc4ea4000 --> order 6
BTW, could you send me a vmcore with the folio data? When reviewing
the patch, I can use the vmcore as a reference to better understand
this case.
I always use the live session, and do not use the vmcore.
I debug the code with live session like this:
1.) Run the crash in terminal 1:
#crash vmlinux /proc/kcore
2.) Open terminal 2, and use hexdump to dump a big file (200M):
#hexdump -n 4096 bigfile |more
You can watch the "bigfile" folio in terminal 1.
#hexdump -n 409600 bigfile |more
Again, you can watch the "bigfile" folio in terminal 1.
...
Thanks
Huang Shijie