You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously we used to increase stack sizes in KMSAN builds: 060de96, but later it was deemed unnecessary, because the stack usage was not that big as compared to KASAN.
Trying to assess the impact of KMSAN on stack frame sizes, I took two kernel images built with and without CONFIG_KMSAN=y containing roughly 300K functions, and grepped them for sub.*rsp, assuming that the value subtracted from $rsp at function prologue is the stack frame size.
I filtered out some corner cases (functions with duplicate names, functions that only had sub.*rsp in one of the two builds, functions with more than one sub.*rsp instruction) and ended up with a list of 45415 functions with their stack frame sizes in KMSAN and non-KMSAN builds: bloat-kmsan-nokmsan.txt
As reported at https://lore.kernel.org/lkml/[email protected]/T/, KMSAN sometimes smashes the kernel stack.
Previously we used to increase stack sizes in KMSAN builds: 060de96, but later it was deemed unnecessary, because the stack usage was not that big as compared to KASAN.
Trying to assess the impact of KMSAN on stack frame sizes, I took two kernel images built with and without CONFIG_KMSAN=y containing roughly 300K functions, and grepped them for
sub.*rsp
, assuming that the value subtracted from$rsp
at function prologue is the stack frame size.I filtered out some corner cases (functions with duplicate names, functions that only had
sub.*rsp
in one of the two builds, functions with more than onesub.*rsp
instruction) and ended up with a list of 45415 functions with their stack frame sizes in KMSAN and non-KMSAN builds: bloat-kmsan-nokmsan.txtFrom this list it was possible to calculate the relative bloat: bloat-percentage.txt
(first column is the line number in the sorted file)
So 44673 out of 45415 interesting functions (98.4%) had their stack frames increased, and for 34580 (76.1%) their stack usage increased by >= 100%.
This suggests we should probably double the stacks in KMSAN builds and see if that helps.
The text was updated successfully, but these errors were encountered: