From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 DCD7C4A8FF4; Tue, 15 Sep 2026 16:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789490997; cv=none; b=tf/j+Eg29Lahy9a7ieFtwbC8AncVge/AzV7AqLsV+QAR+9LkMKkoLb6AJX0Q7EQX71gFG2Atb6s7mRcreCePPOp2nB76Gtn/bGdGeC/VM75t83WiDsLx6K99lLCKMWMKy3j8kzmN5W6bTBfdgA8vXJTGwH3h4fKGsf4AS/STuXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789490997; c=relaxed/simple; bh=IwR8IlFOE6PSPcZfHECA/JijCdOBsbl5qQ9F+b4wUZU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=d4tu3rV+x4xAedfxxMJDoM/fDD2VRORSdw0kOmdW6Vcewt2Yda9t2Rfgz4+v46FOzQMtdwP0JcU51rTT8bkLAKcY/bLaJCLuNmoIVafVa7/takR9chJisrNZ2IyoQdDtOlAWn2zTx+uEWQEdI676bmglYiZeHtEen81n0VNRBgg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eopCimML; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eopCimML" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F0C41F00893; Tue, 15 Sep 2026 16:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1789490994; bh=ZPoduYurjOSFdX2MA/IC1rIMtpjmo5SA4Yn6x4dnVcc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=eopCimMLWecJrXWLsR7ihQavgXLke2UlIaFCZIuHOMGMRZ/oUOaUP37XVJe+Hrf6l KJfPMz4CB1RLGbIfcjMRXnMcCDrTDOKiNgttsiyfoxbBif0iWU6RAHjxcmWKyApIIx mbedXmufA5qFMHum6a4/+ehaPu4IZWEuqjpiUwP/mf2L11xuhGD/qU3JvUh88k6VMz Nn00+ONModRc6bWnrxAGXXMH/jyXlwsAnXCQwdhQVCuYNLpqVignJh/umWO7DMzYNx 1FbIyqHv0slsSorFvnIY+n6Xrr4R0HnDH6ipSzxKwqcLZfVGw3OVr6sRMhOOzyAx9u iSlOBJjPOilyQ== Date: Tue, 15 Sep 2026 09:49:54 -0700 From: Kees Cook To: "Lorenzo Stoakes (ARM)" Cc: Linus Torvalds , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , Masahiro Yamada , Alexey Gladkov , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Arnd Bergmann , Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , Ilias Apalodimas , Josh Poimboeuf , Peter Zijlstra , Miguel Ojeda , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , Onur =?iso-8859-1?Q?=D6zkan?= , Jonathan Corbet , Randy Dunlap , "Gustavo A. R. Silva" , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, Jens Axboe , linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 14/21] kbuild: batch module finalisation Message-ID: <202609150943.000EC9277@keescook> References: <20260914-build-speedup-v2-0-39817ec5db23@kernel.org> <20260914-build-speedup-v2-14-39817ec5db23@kernel.org> <202609141056.6AE2C82E@keescook> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Sep 15, 2026 at 11:44:01AM +0100, Lorenzo Stoakes (ARM) wrote: > On Mon, Sep 14, 2026 at 11:00:27AM -0700, Kees Cook wrote: > > On Mon, Sep 14, 2026 at 10:22:13AM +0100, Lorenzo Stoakes (ARM) wrote: > > > Module finalisation on allmodconfig builds consists of a large number of > > > very short-lived jobs, and the make job dispatcher cannot possibly dispatch > > > jobs fast enough. > > > > This "cannot possibly" sounds like a weird LLM language intensifier. I'd > > Again that's my writing actually, probably best to stop assuming LLM now ;) Apologies; whatever the opposite of the Turing Test is, I have failed. :P The AIs are winning: humans are suspicious of each other now. :) > > rather a concrete description of the problem, not this kind of > > (redundant?) vagueness. > > In the very next paragraph I say: > > For allmodconfig x86-64 this can be on the order of ~22,000 jobs of > a few milliseconds in duration each. > > You did also say that the commit messages were over-long, so there's a > trade-off here :) Right, sorry, I meant I understand the need to collapse the jobs together, I was just trying to understand where the "128" came from. > But in more detail, allmodconfig tree (~11k modules on x86-64), best of 2, > make modules with *.ko *.mod.o deleted: > > modules per chunk instances wall > ----------------- --------- ------ > 1 11171 10.22s > 2 5586 6.72s > 4 2793 4.97s > 8 1397 4.26s > 16 699 4.05s > 32 350 4.05s > 64 175 4.07s > 128 88 4.05s > 256 44 4.03s > 512 22 4.18s > > which I think makes things clearer. > > So realistically 32 - 256 is the right sort of range. You also have to take > into account the fact that you might be building fewer modules. This answers it, thank you! > The argument for 128 is that this is the mid-point of where the graph > flattens off for a larger number of modules. > > For a smaller number, you're going to have a single dispatch or less and > the delta won't be that much anyway. Understood. I guess I'm trying to better understand the chosen balance point. Does machine CPU count matter at all for this? i.e. "16" is the first one to hit the 4 second line, can that be "better" than 128 for smaller system (or fewer modules)? I'm trying to consider CIs and such that are bounded to 8 or fewer threads, etc. > So it's very much a sensibly derived empirical value. > > I'll update the commit message to give this rationale there. Thanks! -Kees -- Kees Cook