linux/Documentation
Jiajian Ye 9c8a0a8e59 tools/vm/page_owner_sort.c: support for user-defined culling rules
When viewing page owner information, we may want to cull blocks of
information with our own rules.  So it is important to enhance culling
function to provide the support for customizing culling rules.
Therefore, following adjustments are made:

1. Add --cull option to support the culling of blocks of information
   with user-defined culling rules.

	./page_owner_sort <input> <output> --cull=<rules>
	./page_owner_sort <input> <output> --cull <rules>

  <rules> is a single argument in the form of a comma-separated list to
  specify individual culling rules, by the sequence of keys k1,k2, ....
  Mixed use of abbreviated and complete-form of keys is allowed.

  For reference, please see the document(Documentation/vm/page_owner.rst).

Now, assuming two blocks in the input file are as follows:

	Page allocated via order 0, mask xxxx, pid 1, tgid 1 (task_name_demo)
	PFN xxxx
	 prep_new_page+0xd0/0xf8
	 get_page_from_freelist+0x4a0/0x1290
	 __alloc_pages+0x168/0x340
	 alloc_pages+0xb0/0x158

	Page allocated via order 0, mask xxxx, pid 32, tgid 32 (task_name_demo)
	PFN xxxx
	 prep_new_page+0xd0/0xf8
	 get_page_from_freelist+0x4a0/0x1290
	 __alloc_pages+0x168/0x340
	 alloc_pages+0xb0/0x158

If we want to cull the blocks by stacktrace and task command name, we can
use this command:

	./page_owner_sort <input> <output> --cull=stacktrace,name

The output would be like:

	2 times, 2 pages, task_comm_name: task_name_demo
	 prep_new_page+0xd0/0xf8
	 get_page_from_freelist+0x4a0/0x1290
	 __alloc_pages+0x168/0x340
	 alloc_pages+0xb0/0x158

As we can see, these two blocks are culled successfully, for they share
the same pid and task command name.

However, if we want to cull the blocks by pid, stacktrace and task command
name, we can this command:

	./page_owner_sort <input> <output> --cull=stacktrace,name,pid

The output would be like:

	1 times, 1 pages, PID 1, task_comm_name: task_name_demo
	 prep_new_page+0xd0/0xf8
	 get_page_from_freelist+0x4a0/0x1290
	 __alloc_pages+0x168/0x340
	 alloc_pages+0xb0/0x158

	1 times, 1 pages, PID 32, task_comm_name: task_name_demo
	 prep_new_page+0xd0/0xf8
	 get_page_from_freelist+0x4a0/0x1290
	 __alloc_pages+0x168/0x340
	 alloc_pages+0xb0/0x158

As we can see, these two blocks are failed to cull, for their PIDs are
different.

2. Add explanations of --cull options to the document.

This work is coauthored by
	Yixuan Cao
	Shenghong Han
	Yinan Zhang
	Chongxi Zhao
	Yuhong Feng

Link: https://lkml.kernel.org/r/20220312145834.624-1-yejiajian2018@email.szu.edu.cn
Signed-off-by: Jiajian Ye <yejiajian2018@email.szu.edu.cn>
Cc: Yixuan Cao <caoyixuan2019@email.szu.edu.cn>
Cc: Shenghong Han <hanshenghong2019@email.szu.edu.cn>
Cc: Yinan Zhang <zhangyinan2019@email.szu.edu.cn>
Cc: Chongxi Zhao <zhaochongxi2019@email.szu.edu.cn>
Cc: Yuhong Feng <yuhongf@szu.edu.cn>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-03-24 19:06:45 -07:00
..
ABI Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
accounting - A bunch of fixes: forced idle time accounting, utilization values 2022-01-23 17:35:27 +02:00
admin-guide Merge branch 'akpm' (patches from Andrew) 2022-03-24 14:14:07 -07:00
arc docs: ARC: Improve readability 2021-12-10 14:28:01 -07:00
arm Documentation: arm: marvell: Extend Avanta list 2022-01-27 11:22:34 -07:00
arm64 Merge branch 'for-next/mte' into for-next/core 2022-03-14 19:01:23 +00:00
block block: remove biodoc.rst 2022-02-15 07:47:52 -07:00
bpf Documentation/bpf: Add documentation for BPF_PROG_RUN 2022-03-09 14:19:22 -08:00
cdrom Documentation: Fix links for udftools project and pktcdvd tool 2022-02-15 16:15:33 -07:00
core-api Folio changes for 5.18 2022-03-22 17:03:12 -07:00
cpu-freq cpufreq: Reintroduce ready() callback 2022-02-09 13:18:49 +05:30
crypto
dev-tools Merge branch 'akpm' (patches from Andrew) 2022-03-24 14:14:07 -07:00
devicetree Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
doc-guide docs: discourage use of list tables 2022-01-07 09:33:13 -07:00
driver-api VFIO updates for v5.18-rc1 2022-03-24 12:35:59 -07:00
fault-injection
fb
features nds32: Remove the architecture 2022-03-07 13:54:59 +01:00
filesystems Filesystem folio changes for 5.18 2022-03-22 18:26:56 -07:00
firmware_class
firmware-guide ACPI: docs: gpio-properties: Unify ASL style for GPIO examples 2022-03-08 20:04:51 +01:00
fpga
gpu Revert "fbcon: Disable accelerated scrolling" 2022-02-02 15:15:11 +01:00
hid
hwmon hwmon: Add driver for Texas Instruments TMP464 and TMP468 2022-03-03 07:40:42 -08:00
i2c Docs: Fixes link to I2C specification 2021-12-31 14:39:28 +01:00
ia64
ide
iio
infiniband
input
isdn
kbuild doc: kbuild: fix default in imply table 2022-01-08 18:28:21 +09:00
kernel-hacking docs: fix typo in Documentation/kernel-hacking/locking.rst 2022-01-27 11:22:33 -07:00
leds
litmus-tests
livepatch Documentation: livepatch: Add livepatch API page 2021-12-23 11:35:53 +01:00
locking Documentation/locking/locktypes: Fix PREEMPT_RT _bh() description 2022-03-04 10:13:19 -07:00
m68k
maintainer vfio-pci: Provide reviewers and acceptance criteria for variant drivers 2022-03-17 09:57:11 -06:00
mhi
mips
misc-devices
netlabel
networking devlink: expose instance locking and add locked port registering 2022-03-16 12:56:31 -07:00
nios2
nvdimm
openrisc
parisc
PCI
pcmcia
power Merge branches 'pm-opp', 'pm-devfreq' and 'powercap' 2022-01-10 18:00:31 +01:00
powerpc
process overflow updates for v5.18-rc1 2022-03-21 19:46:41 -07:00
RCU Merge branches 'doc.2021.11.30c', 'exp.2021.12.07a', 'fastnohz.2021.11.30c', 'fixes.2021.11.30c', 'nocb.2021.12.09a', 'nolibc.2021.11.30c', 'tasks.2021.12.09a', 'torture.2021.12.07a' and 'torturescript.2021.11.30c' into HEAD 2021-12-09 11:38:09 -08:00
riscv riscv: Move KASAN mapping next to the kernel mapping 2022-01-19 17:54:04 -08:00
s390
scheduler Changes in this cycle were: 2022-03-22 14:39:12 -07:00
scsi
security selinux/stable-5.18 PR 20220321 2022-03-21 20:47:54 -07:00
sh
sound ALSA: hda/realtek: Add alc256-samsung-headphone fixup 2022-03-22 21:51:02 +01:00
sparc
sphinx Reword note on missing CJK fonts 2022-02-24 12:26:13 -07:00
sphinx-static docs: add support for RTD dark mode 2021-12-10 14:05:55 -07:00
spi spi: pxa2xx_spi: Convert to use GPIO descriptors 2022-01-31 15:17:27 +00:00
staging Three small documentation fixes. 2022-01-22 09:02:57 +02:00
target
timers rcu: Remove the RCU_FAST_NO_HZ Kconfig option 2021-11-30 17:24:47 -08:00
tools Real Time Analysis Tool updates for 5.18 2022-03-23 11:08:10 -07:00
trace Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
translations It has been a moderately busy cycle for documentation; some of the 2022-03-21 14:13:25 -07:00
tty Documentation: add TTY chapter 2021-11-26 16:27:43 +01:00
usb docs: ABI: fixed req_number desc in UAC1 2021-12-30 12:10:44 +01:00
userspace-api media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
virt ARM: 2022-03-24 11:58:57 -07:00
vm tools/vm/page_owner_sort.c: support for user-defined culling rules 2022-03-24 19:06:45 -07:00
w1
watchdog
x86 Thermal control updates for 5.18-rc1 2022-03-21 14:35:11 -07:00
xtensa
.gitignore
arch.rst docs: Add documentation for ARC processors 2021-11-29 14:53:11 -07:00
asm-annotations.rst linkage: remove SYM_FUNC_{START,END}_ALIAS() 2022-02-22 16:21:34 +00:00
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py docs: pdfdocs: Pull LaTeX preamble part out of conf.py 2022-02-24 12:26:13 -07:00
COPYING-logo
docutils.conf
dontdiff
index.rst docs: Hook the RTLA documents into the kernel docs build 2022-01-27 11:20:39 -07:00
Kconfig
logo.gif
Makefile docs: Makefile: Add -no-shell-escape option to LATEXOPTS 2022-02-14 12:50:17 -07:00
memory-barriers.txt asm-generic: introduce io_stop_wc() and add implementation for ARM64 2021-12-22 10:44:53 +00:00
SubmittingPatches
watch_queue.rst