linux/tools/mm
Kaushlendra Kumar 2197c4c6bd tools/mm/page_owner_sort: fix timestamp comparison for stable sorting
commit 7013803444 upstream.

The ternary operator in compare_ts() returns 1 when timestamps are equal,
causing unstable sorting behavior. Replace with explicit three-way
comparison that returns 0 for equal timestamps, ensuring stable qsort
ordering and consistent output.

Link: https://lkml.kernel.org/r/20251209044552.3396468-1-kaushlendra.kumar@intel.com
Fixes: 8f9c447e2e ("tools/vm/page_owner_sort.c: support sorting pid and time")
Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Cc: Chongxi Zhao <zhaochongxi2019@email.szu.edu.cn>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-08 10:14:50 +01:00
..
.gitignore tools/vm: rename tools/vm to tools/mm 2023-01-18 17:12:55 -08:00
Makefile tools/mm: rm thp_swap_allocator_test when make clean 2024-09-09 16:47:41 -07:00
page-types.c tools/mm: fix compile error 2024-11-14 22:43:48 -08:00
page_owner_sort.c tools/mm/page_owner_sort: fix timestamp comparison for stable sorting 2026-01-08 10:14:50 +01:00
slabinfo-gnuplot.sh tools/vm: rename tools/vm to tools/mm 2023-01-18 17:12:55 -08:00
slabinfo.c tools/mm: -Werror fixes in page-types/slabinfo 2024-10-30 20:14:11 -07:00
thp_swap_allocator_test.c tools/mm: introduce a tool to assess swap entry allocation for thp_swapout 2024-07-10 12:14:51 -07:00
thpmaps tools/mm: add thpmaps script to dump THP usage info 2024-02-22 10:24:38 -08:00