From: Harry Yoo <harry@kernel.org>
To: Xuewen Wang <wangxuewen_ky@163.com>
Cc: vbabka@kernel.org, hao.li@linux.dev, cl@gentwo.org,
rientjes@google.com, akpm@linux-foundation.org,
david@kernel.org, rppt@kernel.org, mhocko@suse.com,
surenb@google.com, sj@kernel.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Xuewen Wang <wangxuewen@kylinos.cn>
Subject: Re: [PATCH v1 1/2] tools/mm: slabinfo: fix inverted numeric sorting
Date: Wed, 2 Dec 2026 18:24:23 +0000 [thread overview]
Message-ID: <axBiRKQ1f7KhBsvk@thinkstation> (raw)
In-Reply-To: <20261118060317.1802620-2-wangxuewen_ky@163.com>
On Wed, Nov 18, 2026 at 02:03:16PM +0800, Xuewen Wang wrote:
> From: Xuewen Wang <wangxuewen@kylinos.cn>
>
> The numeric branches of sort_slabs() return either zero or one for
> unequal keys. Negating these values for -i never yields a positive
> result, so the sort does not swap entries with different numeric keys.
> For example, partial-slab counts 30, 10, 20 remain in that order
> with -P -i instead of being sorted as 10, 20, 30.
>
> Return a positive or negative result for unequal numeric keys so that
> the existing inversion works for size, activity, loss and partial-slab
> sorting. Preserve the alphabetic tie break for equal keys and avoid
> subtracting unsigned counters.
>
> Fixes: c09d87517298 ("slub: add slabinfo tool")
> Signed-off-by: Xuewen Wang <wangxuewen@kylinos.cn>
> ---
Looks good to me,
Acked-by: Harry Yoo (Meta) <harry@kernel.org>
--
Cheers,
Harry / Hyeonggon
next prev parent reply other threads:[~2026-12-02 18:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 6:03 [PATCH v1 0/2] tools/mm: slabinfo: fix inverted sorting and totals Xuewen Wang
2026-11-18 6:03 ` [PATCH v1 1/2] tools/mm: slabinfo: fix inverted numeric sorting Xuewen Wang
2026-12-02 18:24 ` Harry Yoo [this message]
2026-11-18 6:03 ` [PATCH v1 2/2] tools/mm: slabinfo: preserve the average partial object count Xuewen Wang
2026-12-02 18:25 ` Harry Yoo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axBiRKQ1f7KhBsvk@thinkstation \
--to=harry@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@gentwo.org \
--cc=david@kernel.org \
--cc=hao.li@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
--cc=sj@kernel.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=wangxuewen@kylinos.cn \
--cc=wangxuewen_ky@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.