Description
Sub-command "swap" in crash command doesn't show any info about swap
partition in kernel versions 2.6.28 and above
crash> swap
FILENAME TYPE SIZE USED PCT PRIORITY
crash> q
feastlp4:~ #
Analysis
Swap specific information comes from the kernel data structure
swap_info_struct
.The problem starts when it access the fields of swap_info_struct.
In this case
----------------------
flags = INT(vt->swap_info_struct +
OFFSET(swap_info_struct_flags));
if (!(flags & SWP_USED))
continue; <== Hits this case
----------------------
flags gets value '0' and hence it returns with out calculating swap values
This is happening because post 2.6.28 (precisely commit:
ebebbbe904634b0ca1c674457b399f68db5e05b1) changes flag field in
swap_info_struct from 'int' to 'unsigned long'. flags always gets zero
and jumps further calculation.
Fix
Patch has been attached to this mail
Thanks
Sharyathi
Show replies by date