From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=199.89.1.14 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796165646; b=jCc3vNP6hBM467NYMW6g3HJAeWhMkebrPV58Iuxat2l7RiFz0CMThPt329inTFezAg1x i/7P9a1QNILKYmpfQDggeGqTJIgNPQ9aE8nHRZ0mrD9+rU0vfmgW73FLW6P55ocSo8p6r 4Lqx7wsNDoBDyjmJlLMwkHUeiyQhyDA+dKEkcT44qg7NQiibk8XPFZn5xz+lJYxaxOQXs L+9xTdkS32rJ8twpPHaenJ6unXNecErtlUeVsLA3Av9pOfHtTS8/HamerjMxQbJrGWlK9 cPWUol08GEW6mG0wO3JdcbpdKCBXMB4U0Q24cBSE2wZoG/6+ajrOb1OdvCHLSUqksVA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796165646; h=DMARC-Filter:Received:DKIM-Signature:X-Virus-Scanned:Received: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=c0KttdXm/m8o0X1jPuBvX18EjMXYOaBF+2vpChkk9QA=; b=S/rybcWsXVu6a8rGPNTMiguQTle4knWytti5wa6EuoCi73ppqaxQsbHP16AZEHCfcECw Gdy4z6J2kB9sOHlx5qimCxh0sGTfFEgzNw4+8wq6w3GaI0JQ9RN4faNlVqd3qyJlcbUo7 z7k0srVwQpka+NEdWziUgRmgfcS1CcpR8Bs15EHKf7W75GFygPvtJPA8LPu+r1TOzADnQ iZz4bqvuBO4N/VO0D6vlkIldSiNlir3+xmUycUw3F3kdrcTyri27C8rdl6/+d0Pl8axZi u5ZwMhLN1eIFzsNKgnpxwAgaNRjANLia1jc/bDj2KctiDlRGJLf+b4Hmd49W9TqhcQg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=acm.org; spf=pass smtp.mailfrom=acm.org; dkim=pass header.d=acm.org header.i=@acm.org header.a=rsa-sha256 header.s=mr01 header.b=DdNqce3H; arc=none smtp.remote-ip=199.89.1.14 Received: from 011.lax.mailroute.net (011.lax.mailroute.net [199.89.1.14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBA2B606A31A for ; Tue, 1 Dec 2026 22:54:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DBA2B606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=acm.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=acm.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=acm.org header.i=@acm.org header.a=rsa-sha256 header.s=mr01 header.b=DdNqce3H Received: from localhost (localhost [127.0.0.1]) by 011.lax.mailroute.net (Postfix) with ESMTP id 4jfGR12C8jz1XMYJH; Tue, 1 Dec 2026 22:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:from:from:received:received; s=mr01; t= 1796165642; x=1798757643; bh=c0KttdXm/m8o0X1jPuBvX18EjMXYOaBF+2v pChkk9QA=; b=DdNqce3HK7/7n21HW0Uwthuv6V2MYdBme/HHHplinw1A8H0c0oR Wp7d96im4PdeXN3GUubvYivXuv47cnovXENcuwda/7SbxaSmb4dAJwgF+UXq+5As /vtZxGNGBwQ+6TI/fGZo6QCh9GSKJXof+TD79lu1EUqU+M9Z+JBZOZG406GITfhp Kj2yabTB6BQ0nFuOrMEaol+8nLXJ5xAXb6VIEXnFSGG8LuR21VxNDIBcmArjXLrF 1i23rDnmHv8WbVadwVyIOrPn+Km0Em9cLxRbfjfqTfvInTPKoMHEdJJWFWJqVDCw LcFnAu7153xsMAM30lYnMH7HfeKoOhRb7UQ== X-Virus-Scanned: by MailRoute Received: from 011.lax.mailroute.net ([127.0.0.1]) by localhost (011.lax [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id oWnu2SueHQDU; Tue, 1 Dec 2026 22:54:02 +0000 (UTC) Received: from bvanassche.c.googlers.com.com (57.237.82.34.bc.googleusercontent.com [34.82.237.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 011.lax.mailroute.net (Postfix) with ESMTPSA id 4jfGQy2wqwz1XMYJN; Tue, 1 Dec 2026 22:54:02 +0000 (UTC) From: Bart Van Assche To: Joe Perches , Andy Whitcroft Cc: Andrew Morton , linux-kernel@vger.kernel.org, Bart Van Assche Subject: [PATCH 00/10] Make checkpatch faster Date: Tue, 1 Dec 2026 14:53:44 -0800 Message-ID: X-Mailer: git-send-email 2.56.1.911.g883d8bcb20-goog X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi , LLMs tend to run checkpatch often. This patch series makes checkpatch abo= ut twice as fast and prevents that it slows down LLM-based workflows significantly. All then patches have been generated by an LLM. Patches 1-3 avoid or cache the subprocesses. Patches 4-10 reduce regex recompilation, add cheap pre-checks in front of expensive regexes, use a hash for single-word spelling checks, and scan strings in place instead of slicing them. Timings with this series (Perl 5.40, one CPU, --strict): 50 recent commits, tree mode: 11.1 s -> 2.4 s checkpatch -f kernel/sched/core.c: 8.1 s -> 4.1 s checkpatch -f fs/btrfs/inode.c: 8.7 s -> 4.2 s checkpatch -f ufs/core/ufshcd.c: 8.7 s -> 4.3 s The goal is identical output. To check this, I ran the old and new checkpatch.pl on the same inputs and compared stdout, stderr, the exit code and the --fix results. No differences were found apart from line numbers in existing Perl warnings. Two intentional differences are described in patch 3: with -f, a git-tracked file name containing a regex metacharacter no longer makes checkpatch die, and some Perl warnings are printed once instead of once per call. Please consider this patch series for the next merge window. Thanks, Bart. Bart Van Assche (10): checkpatch: pre-filter obsolete MAINTAINERS checks and gate on OBSOLETE checkpatch: cache SPDX license checks and gate on SPDX_LICENSE_TAG checkpatch: cache git and PATH lookups and skip git_is_single_file() checkpatch: skip redundant build_types() rebuilds checkpatch: avoid dynamic regex recompilation in hot checks checkpatch: guard expensive per-line regexes with cheap pre-checks checkpatch: use hash lookups for single-word spelling checks checkpatch: scan ctx_statement_block() in place without slicing checkpatch: scan annotate_values() in place with leading-char dispatch checkpatch: add fast paths to per-line character-scanning helpers scripts/checkpatch.pl | 728 +++++++++++++++++++++++++++++++----------- 1 file changed, 539 insertions(+), 189 deletions(-)