From nobody Mon Oct 6 19:10:03 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD2771F9F73; Thu, 17 Jul 2025 11:37:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752752245; cv=none; b=RgiWbt6jg71gwp19AdNejujDy+4965WV4Id5IniEc40FgBFUF/XFRXFFD9U7Yn79HlS5+cIAsJD7XXSNf3NcaWxj8ZOPPg7pLtRcB42piLxobNUay35HVQINGESQIplw41oRSxtCGz9yztE34ndVZdUMKoUv+aj4LwiOu7ty0ag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752752245; c=relaxed/simple; bh=LZclc8zmVbRhnO1CRhpy4u/m5fe34HId0hi9iXYV0pQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=O5/3SzUd76tD/L5LkSsS7er3Oct6CYwNYS27rGmsYFzoQ1mKsTcZ+jjyCedmtAllKTjjyjM8Z19nZMMCVjwzvY1XqfRZ9RCnUoBBSrMLlwhXXCsMAiGdoT0DHTTp2rtLxIFs5zKDto5EFYh1X8f9XwjhoEaFNU04uXV6HGn/Vck= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jTFjLUu6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jTFjLUu6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EA5CC4CEE3; Thu, 17 Jul 2025 11:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752752245; bh=LZclc8zmVbRhnO1CRhpy4u/m5fe34HId0hi9iXYV0pQ=; h=From:To:Cc:Subject:Date:From; b=jTFjLUu6mEsSa7RGtlRL2ZCF+uqYMKHrqc+hK5NTJl8AhjXIxc+OR3HqmpXj6a8Cl FY0+LZTUiFBMS3Vr4Qpxz3R+DTyTutylcasZm+M/FRUDRaBzMBubeSu62Zqy2bHSig STf0wBJmqPbEfN+785prPyI4QZNXAYrBBoQDQJ6zEC1IF9B5VdMuqBxOaQzLAef38F LIoSBGb6XeIK07nw8W/rSypa7GazVVU3261p1dQrGgt1q7cdmDoTWZOnfwdryjhFod GU+Zm/KwS+wIjmKg8L4ZTik3q06W9+rVWkQHF6ZVDxxZtqsuUwQ7SnjeyBNNO6Q6fX pIApCGT3htI/Q== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1ucMvT-0000000BQtO-1Mlf; Thu, 17 Jul 2025 13:37:23 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , Kees Cook , linux-kernel@vger.kernel.org, Akira Yokosawa Subject: [PATCH v2] sphinx: kernel_abi: fix performance regression with O= Date: Thu, 17 Jul 2025 13:37:19 +0200 Message-ID: X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" 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=3D/tmp/foo SPHINXDIRS=3Dadmin-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', 'ab= i-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 Closes: https://lore.kernel.org/linux-doc/c174f7c5-ec21-4eae-b1c3-f643cca90= d9d@gmail.com/ Signed-off-by: Mauro Carvalho Chehab Tested-by: Akira Yokosawa --- v2: updated description. No changes at the diff itself Documentation/sphinx/kernel_abi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Documentation/sphinx/kernel_abi.py b/Documentation/sphinx/kern= el_abi.py index db6f0380de94..4c4375201b9e 100644 --- a/Documentation/sphinx/kernel_abi.py +++ b/Documentation/sphinx/kernel_abi.py @@ -146,8 +146,10 @@ class KernelCmd(Directive): n +=3D 1 =20 if f !=3D old_f: - # Add the file to Sphinx build dependencies - env.note_dependency(os.path.abspath(f)) + # Add the file to Sphinx build dependencies if the file ex= ists + fname =3D os.path.join(srctree, f) + if os.path.isfile(fname): + env.note_dependency(fname) =20 old_f =3D f =20 --=20 2.50.1