diff options
| author | Kaushlendra Kumar <kaushlendra.kumar@intel.com> | 2025-12-09 10:15:52 +0530 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-12-23 11:23:14 -0800 |
| commit | 7013803444dd3bbbe28fd3360c084cec3057c554 (patch) | |
| tree | 84edba20f9ef349c58fd54db217dd4052b8347be /include | |
| parent | 632b874d59a36caf829ab5790dafb90f9b350fd6 (diff) | |
tools/mm/page_owner_sort: fix timestamp comparison for stable sorting
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: 8f9c447e2e2b ("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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
