twx-linux/Documentation
Mauro Carvalho Chehab 2b16b71a05 sphinx: kernel_abi: fix performance regression with O=<dir>
The logic there which adds a dependency note to Sphinx cache
is not taking into account that the build dir may not be
the source dir. This causes a performance regression:

$ time make O=/tmp/foo SPHINXDIRS=admin-guide htmldocs

	[OUTDATED]
	Added: set()
	Changed: {'abi-obsolete', 'abi-removed', 'abi-stable-files', 'abi-obsolete-files', 'abi-stable', 'abi', 'abi-removed-files', 'abi-testing-files', 'abi-testing', 'gpio/index', 'gpio/obsolete'}
	Removed: set()
	All docs count: 385
	Found docs count: 385

	real    0m11,324s
	user    0m15,783s
	sys     0m1,164s

To get the root cause of the problem (ABI files reported as changed),
I used this changeset:

	diff --git a/Documentation/conf.py b/Documentation/conf.py
	index e8766e689c1b..ab486623bd8b 100644
	--- a/Documentation/conf.py
	+++ b/Documentation/conf.py
	@@ -571,3 +571,16 @@ def setup(app):
	     """Patterns need to be updated at init time on older Sphinx versions"""

	     app.connect('config-inited', update_patterns)
	+    app.connect('env-get-outdated', on_outdated)
	+
	+def on_outdated(app, env, added, changed, removed):
	+    """Track cache outdated due to added/changed/removed files"""
	+    print("\n[OUTDATED]")
	+    print(f"Added: {added}")
	+    print(f"Changed: {changed}")
	+    print(f"Removed: {removed}")
	+    print(f"All docs count: {len(env.all_docs)}")
	+    print(f"Found docs count: {len(env.found_docs)}")
	+
	+    # Just return what we have
	+    return added | changed | removed

Reported-by: Akira Yokosawa <akiyks@gmail.com>
Closes: https://lore.kernel.org/linux-doc/c174f7c5-ec21-4eae-b1c3-f643cca90d9d@gmail.com/
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tested-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/e25673d87357457bc54ee863e97ff8f75956580d.1752752211.git.mchehab+huawei@kernel.org
2025-07-24 08:36:17 -06:00
..
ABI docs: ABI: make the KernelVersion field optional 2025-07-01 13:18:04 -06:00
accel
accounting
admin-guide docs: kernel: Clarify printk_ratelimit_burst reset behavior 2025-07-17 13:47:27 -06:00
arch docs: powerpc: Add htm.rst to table of contents 2025-06-09 14:59:35 -06:00
block Documentation: ublk: document UBLK_F_PER_IO_DAEMON 2025-05-31 14:38:57 -06:00
bpf
cdrom
core-api Documentation: core-api: entry: Replace deprecated KVM entry/exit functions 2025-07-24 08:32:59 -06:00
cpu-freq
crypto
dev-tools
devicetree RISC-V Patches for the 6.16 Merge Window, Part 1 2025-06-06 18:05:18 -07:00
doc-guide docs: sphinx: add a file with the requirements for lowest version 2025-06-25 12:22:48 -06:00
driver-api Documentation: treewide: Replace remaining spinics links with lore 2025-06-21 14:20:51 -06:00
edac cxl/edac: Add CXL memory device soft PPR control feature 2025-05-23 13:25:06 -07:00
fault-injection docs: fault-injection: drop reference to md-faulty 2025-07-24 08:31:46 -06:00
fb fbdev: sstfb.rst: Fix spelling mistake 2025-05-31 10:24:02 +02:00
features LoongArch: Enable ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS 2025-05-30 21:45:42 +08:00
filesystems overlayfs.rst: fix typos 2025-07-15 13:53:46 -06:00
firmware_class
firmware-guide
fpga
gpu drm fixes for 6.16-rc1 2025-06-06 08:09:56 -07:00
hid
hwmon hwmon updates for v6.16 2025-06-03 09:11:26 -07:00
i2c
iio
images
infiniband
input Input: amijoy - make headings compliant w/ guidelines in documentation 2025-05-30 15:34:38 -07:00
isdn
kbuild Kbuild updates for v6.16 2025-06-07 10:05:35 -07:00
kernel-hacking
leds LEDs for v6.16 2025-06-03 12:10:31 -07:00
litmus-tests
livepatch
locking
maintainer
mhi
misc-devices
mm Docs/damon: update titles and brief introductions to explain DAMOS 2025-05-22 14:55:38 -07:00
netlabel
netlink netlink: specs: rt-link: decode ip6gre 2025-06-05 12:50:10 +02:00
networking Documentation: treewide: Replace remaining spinics links with lore 2025-06-21 14:20:51 -06:00
nvdimm
nvme
PCI Merge branch 'pci/misc' 2025-06-04 10:50:45 -05:00
pcmcia
peci
power
process docs: process: discourage pointless boilerplate kdoc 2025-06-21 14:14:33 -06:00
RCU
rust Documentation: rust: testing: add docs on the new KUnit #[test] tests 2025-05-27 20:09:59 +02:00
scheduler docs/sched: Make the sched-stats documentation consistent 2025-06-09 16:23:58 -06:00
scsi
security
sound
sphinx sphinx: kernel_abi: fix performance regression with O=<dir> 2025-07-24 08:36:17 -06:00
sphinx-static docs: CSS: make cross-reference links more evident 2025-06-09 14:43:39 -06:00
spi
staging rpmsg updates for v6.16 2025-06-02 11:06:44 -07:00
sunrpc/xdr
target
tee
timers
tools Documentation/rtla: Describe exit status 2025-07-17 15:29:53 -06:00
trace tracing: doc: fix "for a while" typo 2025-07-08 08:14:28 -06:00
translations Docs/zh_CN: Translate alias.rst to Simplified Chinese 2025-07-06 21:13:46 +08:00
usb Documentation: treewide: Replace remaining spinics links with lore 2025-06-21 14:20:51 -06:00
userspace-api Documentation: ioctl-number: Don't repeat macro names 2025-07-15 14:04:30 -06:00
virt Notable changes: 2025-06-05 11:45:33 -07:00
w1
watchdog
wmi
.gitignore
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py docs: conf.py: several coding style fixes 2025-06-25 12:22:48 -06:00
docutils.conf
index.rst
Kconfig
Makefile docs: Makefile: disable check rules on make cleandocs 2025-06-25 12:22:47 -06:00
memory-barriers.txt
SubmittingPatches
subsystem-apis.rst