[PATCH v2 0/2] mm/slub: Fix debugfs stack trace sorting and simplify sort call

Kuan-Wei Chiu posted 2 patches 1 month, 1 week ago
mm/slub.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
[PATCH v2 0/2] mm/slub: Fix debugfs stack trace sorting and simplify sort call
Posted by Kuan-Wei Chiu 1 month, 1 week ago
Fix the comparison function used for sorting stack trace locations in
the slub debugfs interface. The original implementation violated the
antisymmetry property required by sort(), which could lead to
unreliable ordering of the output. The patches correct the comparison
function to return 0 when counts are equal and replace the unnecessary
use of sort_r() with the simpler sort().
---
Changes in v2:
* Use cmp_int().
* Drop Cc stable. 

v1: https://lore.kernel.org/lkml/20250825013419.240278-1-visitorckw@gmail.com/

Kuan-Wei Chiu (2):
  mm/slub: Fix cmp_loc_by_count() to return 0 when counts are equal
  mm/slub: Replace sort_r() with sort() for debugfs stack trace sorting

 mm/slub.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

-- 
2.34.1
Re: [PATCH v2 0/2] mm/slub: Fix debugfs stack trace sorting and simplify sort call
Posted by Vlastimil Babka 1 month, 1 week ago
On 8/26/25 08:23, Kuan-Wei Chiu wrote:
> Fix the comparison function used for sorting stack trace locations in
> the slub debugfs interface. The original implementation violated the
> antisymmetry property required by sort(), which could lead to
> unreliable ordering of the output. The patches correct the comparison
> function to return 0 when counts are equal and replace the unnecessary
> use of sort_r() with the simpler sort().
> ---
> Changes in v2:
> * Use cmp_int().
> * Drop Cc stable. 
> 
> v1: https://lore.kernel.org/lkml/20250825013419.240278-1-visitorckw@gmail.com/
> 
> Kuan-Wei Chiu (2):
>   mm/slub: Fix cmp_loc_by_count() to return 0 when counts are equal
>   mm/slub: Replace sort_r() with sort() for debugfs stack trace sorting

Applied to slab/for-next, thanks!

>  mm/slub.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>