From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796402875; b=13zJRMF/hNXPEaVCbKbOM+r955KVTGFHEejuzh19TY6ywGdtbK6P8k90LBFU2aoJ7hD2 ufCge/R1/Z68CtGHB9tXY0gtR/49Pj1fDtRYbvzsLPRzUJ7TysEzAZMFN+tqE3ahuoyHo KlXMImuosdWVsUs8SrpKPmOEkUOfQxEuuSchlY8uufyQ/oB2dfp7GsZnLbNKVbLF/IIcA wMzVc6aNGxlYZkZsCV0WE50fYDpSi+09CkRvgbmjKvbMz1oBOW2kylgInGQWrF7G3eyJf lN4KoFxwfx1Ue3Jce1xh65yfFWtV/gWR9rgv0ctjhgTBABuE6WEXqvJqTNzNFzsXRSA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796402875; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=S3K1gqRvncCEX0W3L36VqfNWnAkyAgo2eJOJMmHQvBQ=; b=ACU+CKnAKA5/DXhEW/c5GrEgckT81K0CtnSDc1XnkZBhRpMU4bHaAurFowpb6k4LwiYf Ufw7cX/uG2lmBxELFSTmIGeARKEJ+QWcZeFH788ejQ1hycgi4x1Rg5vEE9eOwoIeEq6fg P67On2eb+N3MTf/o8GsLY7S24/YQp2bjYqiZW+3RvuIQJelCP5eX0K5Nq1V4kpvHcdKW7 IuLnXG4Rpih8do1eK1z2SgeVZGIYNJB1nAU2eEjQ2FtwCB3dd5bMlfTxwjo/m7kfxjuQa orFG07GIOd5Pqnl8R45/m6dyzQXAEMBuxEa/ausjRsEx0i0zWDWFCChwjbg/CFUeBcA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=naA7PElc; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 992B2606A32C; Fri, 4 Dec 2026 16:47:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=naA7PElc Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0F601F00897; Fri, 4 Dec 2026 16:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796402875; bh=S3K1gqRvncCEX0W3L36VqfNWnAkyAgo2eJOJMmHQvBQ=; h=From:To:Cc:Subject:Date; b=naA7PElcg6WB9AZTknSu5N54kKGu+rnvYIDggqg9ozJ5zKD0dGZNiy+pPhsGkiSXQ /wq9mZS6HsmQ2UNkhGPn+1Fn9iGTfDo8U/1g1kHkoeJvAL1Sdg//H/FX2DRYE2AKv9 VyDnfSA9RZ106obP7jeiWYw5IHR7fMXwdM5zA3C9S4ABSTw0iZipXpzgdQNWx3UANL 0boXzcQakTPmbk0iYZxNI0zevBYP4zNvl2u2Dfb8QvhxkU8Cp1c1rCJyVCaH9RVPMq pBSyhw2SS7LOcxqwvfuGus0/wDeRI0Q4Ouy1HZU3h/vcdmNn1e2kvWdV36dumGF4WW ZNyRSGfud2sAw== From: Sasha Levin To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, regressions@lists.linux.dev Subject: [PATCH] perf build: Do not use the mypy cache Date: Fri, 4 Dec 2026 11:47:52 -0500 Message-ID: <20261204164752.853673-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 X-Mailing-List: regressions@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The build runs one mypy process per Python file, in parallel, and since commit b3e9c396d0ac ("perf build: Make mypy build test opt-out (NO_MYPY=1)") it does so whenever mypy is installed. All of them use the default cache, .mypy_cache in tools/perf of the source tree. Since mypy 1.20 that cache is an SQLite database by default. mypy 2.4.1 sets the journal mode of the database every time it opens it, and that fails if another process has the database locked at that moment: sqlite3.OperationalError: database is locked mypy reports this as an internal error and the build fails: error: INTERNAL ERROR -- Please try using mypy master on GitHub: [...] make[3]: *** [util/Build:426: /tmp/kci/kernel_build/util/setup.py.mypy_log] Error 1 Which files fail changes from build to build. KernelCI's arm64 perf build of mainline, with mypy 2.4.1, has failed this way in 17 of 22 builds since November 26. Pass --cache-dir=/dev/null so that mypy uses no cache. The build also no longer writes .mypy_cache into the source tree. mypy does not start worker processes without a cache and exits with "Cache must be enabled in parallel mode" when MYPY_NUM_WORKERS or num_workers in a mypy configuration file asks for them, so set MYPY_NUM_WORKERS=0 for these runs. Each run checks a single file, so workers would not help. Fixes: b3e9c396d0ac ("perf build: Make mypy build test opt-out (NO_MYPY=1)") Reported-by: kernelci.org bot Closes: https://lore.kernel.org/all/179589234320.273234.15340882774679334017@kernelci.org/ Signed-off-by: Sasha Levin --- tools/perf/Makefile.perf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 4cc5bb3011da4..142237fc626f4 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -269,6 +269,11 @@ endif # (substituting escaped spaces so multi-word overrides like MYPY="mypy --strict" # are removed as a single token) so child Makefile.build sub-makes inherit the # MYPYPATH-wrapped export MYPY environment variable. +# One mypy process runs per file and they run in parallel. mypy's cache cannot +# be shared by concurrent runs (opening its SQLite database fails with +# "database is locked"), so turn it off. mypy does not start worker processes +# without a cache, so set MYPY_NUM_WORKERS=0, which also overrides num_workers +# in a mypy configuration file. ifneq ($(force_fixdep),1) MAKEOVERRIDES := $(subst __SPACE__,\ ,$(filter-out MYPY=%,$(subst \ ,__SPACE__,$(MAKEOVERRIDES)))) ifeq ($(NO_MYPY),1) @@ -278,7 +283,8 @@ ifneq ($(force_fixdep),1) endif ifneq ($(MYPY),) - override MYPY := MYPYPATH=$(srctree)/tools/perf/python $(MYPY) --ignore-missing-imports + override MYPY := MYPYPATH=$(srctree)/tools/perf/python MYPY_NUM_WORKERS=0 $(MYPY) \ + --ignore-missing-imports --cache-dir=/dev/null endif endif base-commit: 007722b8211f7b34fdf21b1e6a9c32497633ea29 -- 2.53.0