Go to file
Yuanzheng Song ad861069dc tools/vm/slabinfo: use alphabetic order when two values are equal
BugLink: https://bugs.launchpad.net/bugs/1990190

commit 4f5ceb8851f0081af54313abbf56de1615911faf upstream.

When the number of partial slabs in each cache is the same (e.g., the
value are 0), the results of the `slabinfo -X -N5` and `slabinfo -P -N5`
are different.

/ # slabinfo -X -N5
...
Slabs sorted by number of partial slabs
---------------------------------------
Name                   Objects Objsize           Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
inode_cache              15180     392         6217728        758/0/1   20 1   0  95 a
kernfs_node_cache        22494      88         2002944        488/0/1   46 0   0  98
shmem_inode_cache          663     464          319488         38/0/1   17 1   0  96
biovec-max                  50    3072          163840          4/0/1   10 3   0  93 A
dentry                   19050     136         2600960        633/0/2   30 0   0  99 a

/ # slabinfo -P -N5
Name                   Objects Objsize           Space Slabs/Part/Cpu  O/S O %Fr %Ef Flg
bdev_cache                  32     984           32.7K          1/0/1   16 2   0  96 Aa
ext4_inode_cache            42     752           32.7K          1/0/1   21 2   0  96 a
dentry                   19050     136            2.6M        633/0/2   30 0   0  99 a
TCPv6                       17    1840           32.7K          0/0/1   17 3   0  95 A
RAWv6                       18     856           16.3K          0/0/1   18 2   0  94 A

This problem is caused by the sort_slabs().  So let's use alphabetic order
when two values are equal in the sort_slabs().

By the way, the content of the `slabinfo -h` is not aligned because the

`-P|--partial Sort by number of partial slabs`

uses tabs instead of spaces.  So let's use spaces instead of tabs to fix
it.

Link: https://lkml.kernel.org/r/20220528063117.935158-1-songyuanzheng@huawei.com
Fixes: 1106b205a3 ("tools/vm/slabinfo: add partial slab listing to -X")
Signed-off-by: Yuanzheng Song <songyuanzheng@huawei.com>
Cc: "Tobin C. Harding" <tobin@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2022-10-17 15:01:45 +02:00
Documentation dt-bindings: arm: qcom: fix MSM8916 MTP compatibles 2022-10-17 15:01:44 +02:00
LICENSES
arch KVM: x86: Avoid theoretical NULL pointer dereference in kvm_irq_delivery_to_apic_fast() 2022-10-17 15:01:32 +02:00
block blk-mq: don't create hctx debugfs dir until q->debugfs_dir is created 2022-10-17 15:00:32 +02:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-08-26 11:10:49 +02:00
crypto crypto: drbg - make reseeding from get_random_bytes() synchronous 2022-08-26 11:10:37 +02:00
debian UBUNTU: debian/dkms-versions -- update from kernel-versions (main/2022.09.19) 2022-09-16 11:03:41 +02:00
debian.master UBUNTU: Start new release 2022-10-17 15:00:05 +02:00
drivers plip: avoid rcu debug splat 2022-10-17 15:01:43 +02:00
fs NFSv4/pnfs: Fix a use-after-free bug in open 2022-10-17 15:01:40 +02:00
include KVM: Add infrastructure and macro to mark VM as bugged 2022-10-17 15:01:31 +02:00
init random: handle latent entropy and command line from random_init() 2022-08-26 11:10:31 +02:00
ipc ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() 2022-08-26 11:08:10 +02:00
kernel tracing: Have filter accept "common_cpu" to be consistent 2022-10-17 15:01:36 +02:00
lib locking/refcount: Consolidate implementations of refcount_t 2022-09-16 10:59:59 +02:00
mm mm/mmap.c: fix missing call to vm_unacct_memory in mmap_region 2022-10-17 15:01:07 +02:00
net vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout() 2022-10-17 15:01:44 +02:00
samples samples/kretprobes: Fix return value if register_kretprobe() failed 2022-01-13 18:42:26 +01:00
scripts scripts/faddr2line: Fix vmlinux detection on arm64 2022-10-17 15:01:21 +02:00
security apparmor: Fix memleak in aa_simple_write_to_buffer() 2022-10-17 15:01:38 +02:00
sound ALSA: info: Fix llseek return value when using callback 2022-10-17 15:01:34 +02:00
tools tools/vm/slabinfo: use alphabetic order when two values are equal 2022-10-17 15:01:45 +02:00
ubuntu UBUNTU: [Packaging] Add support for ODM drivers 2021-01-26 17:27:59 -07:00
usr
virt KVM: Add infrastructure and macro to mark VM as bugged 2022-10-17 15:01:31 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS MAINTAINERS: co-maintain random.c 2022-08-26 11:09:46 +02:00
Makefile Makefile: link with -z noexecstack --no-warn-rwx-segments 2022-10-17 15:00:06 +02:00
README
Ubuntu.md UBUNTU: [Packaging] update Ubuntu.md 2021-11-05 16:43:42 +01:00
dropped.txt
snapcraft.yaml
update-dkms-versions UBUNTU: [Packaging] resync update-dkms-versions helper 2021-11-26 15:10:03 +01:00
update-version-dkms UBUNTU: [Packaging] switch to kernel-versions 2021-09-20 18:50:21 +02:00

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.