From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7F3449C4D3 for ; Tue, 15 Sep 2026 11:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471809; cv=none; b=HMv60/Qjp+0p1l3gP32YlE3LFvRAJbm6TYWy8u5fQpsmu/A1pfFN4cISiQ3MVCqX6vM0Ggna+d0phrRv0ISRcBX2vUWYf4/u7Pk0pd6WzAvG3M1Z9dtlQUNcBSTZj6kfWG9tWy/aEEIMzS0W0qThcq97z3l72ekTk/sPVktvwWY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471809; c=relaxed/simple; bh=APKTuDGLjMsk92bnnkXJ0rRlkzi8IPJqTj2KURSVBU4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n94HIPuo4ghCTADM/sHpcZ7hkd5+kZ4gHet0ZHSXUUjGMkjvOYp7T/EkcviLmLH/a2xnYhx7+HfNQsVegGZrlbbehet6g53o/Z5GS9KVUzsCXVZY+fT9JTuDZsZYRgCkDz4UqHTFZWQ6DdfvMrSCu8vEvP/e623+33BcGlSScNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QfmW0HZG; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QfmW0HZG" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-495437bb891so5802035e9.1 for ; Tue, 15 Sep 2026 04:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789471803; x=1790076603; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=dGOErKOPioTgO3v0/s/JdPfHHqPEsYrQAaTIvwRdmxw=; b=QfmW0HZGIofUmjnkWGL2TIVkFUxUuxZhOFjQCkuHPy/WVprMzaImb5IXvjMXS/wCGL uT++ASkA8Nzq8SsnOaIO0UueO+47EwRvo5F5Q2iv3015O88zbQeDLcIPKzLSIcrifmLG RVNd4ny1+Cy+QmrUym6h9ZUTtl8MXydeYJyp4q1FqUlyFJQXlfCStv7fqRBhRq+m6drU 2MOKbXWfrGw4Cn3wFCJXObY+cq2LnTd2bB/lN0FlToSkrHYz2p1ue1fBhw1OzHr5z4oA 4tpDK1zE80uk+drClpQQOLiuwshUO/kVmbzbC0pFA/whcZ8lOZHZwDWrcDKDnhhs+UpU /o/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789471803; x=1790076603; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dGOErKOPioTgO3v0/s/JdPfHHqPEsYrQAaTIvwRdmxw=; b=mgv3QyvinhHQw1qjBhPImcGDFkXIWtitjROjTv6Qvgh7t42Gplu7smCmzuLXUOm7E3 BkrF3RafiHU39y1S4BeIXFW7S6sNbbVPwT3H7aGAq+zTJw1dtNrhsHfU2hLeKsUEeYwT aELkRkbfQtKKgYUIrCE37K3CO1eQZexUf8nTtI3plRuFe2L24yhhsFJBZxeaHYRk2YNk 80VYNXYbH4wespZNUKypwv0HlAi5IgKHpehf2mMOG/jWuj0QBk1tlhKHC9Co5aoqiANI 0f91QsczCWpmAGaVh7s8mfCfHsK7Muw1c7d3Nq8sW5P2EuuceBM8hIruwH3FDdrTpWQI b+DA== X-Forwarded-Encrypted: i=1; AKwUvByRUaJEeIctOUSD83o8gl2sqGoZCDL6NHFYRwb3CL3m2fpnLSP0W+axixMYEtfSkSote0j3oyfjF1uSe3I=@vger.kernel.org X-Gm-Message-State: AFuF++k8PUpTK0MtIqP6+eljIm6dlA0ZT+D4Y21rCWqjrSVXkVSoCnLT KQ6Z1Y5aCZed1BlrIAAiApPfZmy6TswyRsT+VUpNftx7YqXoJSBhVid0 X-Gm-Gg: AYBFou27O9SRqy0/F6cKaNJ+rn54de82+b0gKTtB72zOAJp/IDNyEUjOSqajTp436EK 0utFVEm+ttSZc+rZK8Eo8wP2Nw7JezABdRjGMsI9OaPYW8pgQNGn6FRqFwrIMwyj/AFfm1mCR5J jhB6ilqnTIfgMojgTVF1x6lahVKURLXVl/j/7vljC0ddSXplUBalhDcl9Fdzuo6ZY1D+W6ZUIFJ xFRX1kT/ylo7YK/0UmWpMfngipIqH8zM1tv2bLEdqSXjU0l2WxRn7TrTxyKsvE+DLhH8Kk3IASC Q+7yZUwsb044Yo9mr+4STEnhyhrl3wyo+U8nuvc/1nSZVsY5XnGZSQ3hpWBU+CBAm+locSFgZhh /JgRLEL2kfy1RQvAG9uixBLH7DwS8pLIYAWZ4/g1xpZFEX+PDVZCTyK+h4+5PFVPRmmlusc2pny rcP9A2oBHDMZP8SI/xvvEBL70w276/uR6fHo3UFbRxlwdzggqtTpYvFi5tCJsvSN2QzH6Uek+ST 2YG0EcpdNdNKgtUZaBAkAlfv+AIxfcuIyjY X-Received: by 2002:a05:600c:33a1:b0:49d:28b1:260d with SMTP id 5b1f17b1804b1-49e7d74ce16mr30558965e9.12.1789471802734; Tue, 15 Sep 2026 04:30:02 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486eb32d3c7sm31448164f8f.10.2026.09.15.04.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2026 04:30:02 -0700 (PDT) Date: Tue, 15 Sep 2026 12:29:59 +0100 From: David Laight To: "Lorenzo Stoakes (ARM)" Cc: Kees Cook , 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 , =?UTF-8?B?QmrDtnJu?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , Onur =?UTF-8?B?w5Z6a2Fu?= , 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 17/21] objtool: decode instructions and resolve branch targets in parallel Message-ID: <20260915122959.2348bf90@pumpkin> In-Reply-To: References: <20260914-build-speedup-v2-0-39817ec5db23@kernel.org> <20260914-build-speedup-v2-17-39817ec5db23@kernel.org> <202609141112.F8983EE9C@keescook> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kbuild@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 15 Sep 2026 11:09:25 +0100 "Lorenzo Stoakes (ARM)" wrote: > > > +static unsigned int decode_threads(unsigned long text_size) > > > +{ > > > + const long nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); > > > + > > > + if (text_size < DECODE_THREADED_MIN_TEXT || nr_cpus < 2) > > > + return 1; The text_size check ought to be before the sysconf() call. > > > + > > > + return min_t(unsigned int, nr_cpus, DECODE_MAX_THREADS); Why min_t() - you might as well make nr_cpus 'unsigned int'. > > > +} > > > > No, anything using _SC_NPROCESSORS_ONLN internally is wrong, whether its > > pigz or objtool. > > Why? We shouldn't cap a 4 CPU box to 4 CPUs? You almost certainly don't want to use more... (Unless they end up waiting for disk) > > The idea is that the empirically obtained 16 core limit should naturally be > capped to the number of CPUs. The 'empirical' limit is very likely to be system dependant. There might also be situations where you don't want the build to run as fast as possible because the system is performing other workloads. (Not to mention if you have had to add tracing to find a bug.) > > I guess in a world where make hands jobs off this could be dropped, though, > if the complexity there seems worthwhile. You need to pull tokens out of the make pipe :-) David