From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 5CCE24A2048 for ; Tue, 15 Sep 2026 11:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471807; cv=none; b=IypAOseuLoCZudaCXU9eUCE7gCHuHFSRbguQBjL6Iwb7tE1C/R+nYlPcEx/1syyAWdAEkBDYbRPMc9wc93gcR8LCnRWfhOmEgEC0Y7JoJ+OTE0mmcSBoyfLqrEBj5GG28eYmIysI9DN2ecAkTjr5yAWZXe8iGp7MxGfArX/KhSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789471807; c=relaxed/simple; bh=APKTuDGLjMsk92bnnkXJ0rRlkzi8IPJqTj2KURSVBU4=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jkqhMaeAaQKwX0FFw5xTC0peybIA/6iP7gcCGZt2rUusA295R+zLvhgvXafjxYZMtZQ7jxhaNOKLogVRFraP8UOsQbwpnz+AuZE5K0BAPg1ITBk9rU/Y3bNAn3sziTeKKuTD0OyOG7BRdH0YjuC6hjqKfpwEh7birG/vCxT4ZAk= 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.48 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-f48.google.com with SMTP id 5b1f17b1804b1-495437bb891so5802075e9.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=Nv+KmAXdjjVdud9EBETPFSifoCKFnouiDOTfu90rNf+FLK7YdbvAqyLCp1TGbt2p3n YPOKOEH7If6NwCrydvuYuxR1ni40jnYx5GGUeOjrRUSHIiEm1kU9TtPPgR2+C6VmWIXn vtxls4XlxynEgzXYDPeihkt18mfGyCxWbdokM1W17bMdm0aXm7eA8lrEN3f1ACDtSB9H cpHxfEbvP1DMF0PspjqnaJocLeAcfoL6QyO55Yl8toJEA1pQ0v5fd3eoDOjiuv34XRvo kanCP93C1jtEwwD1VNPjLtGg+ko+f6bsTTbnUxED4zGjEvx9f1y5HFCSgsEkEhARjABq pfrg== X-Forwarded-Encrypted: i=1; AKwUvBysUvl15s9yuTNaLo0PpE+yHyyNOk3Y+5KieqlP4RwwwDcxh0AJIkNMcYKm7tbqGqRWZH6dd5z+K8C1aCimcA==@vger.kernel.org X-Gm-Message-State: AFuF++m9xfB8M+ek6qLsmR2GcF3GPMT+kow5gwOjahgSlsiwpFipsFET BxxhVCDqC5hg8wEQ036Xmf0i5QNBY/hOKJDYF/00YmUDxt3XMLOkDBjz X-Gm-Gg: AYBFou031UFlXlZIj9t28iiBtsWmn8AJprJQJ8TUbNcBmu2SG7HXFOy5QHQMOKd9/RR bK+50YKqoAVjX1IViIckSvYJ+0eKMAFlpzNrReRvOokrRrfXgXrxKa7RSwGQIv5YY3PwnOHjSlp H+WWWm1B7mga3qimPGAwPMyyY3iqn5SCdtfN3zpmxVa3HwM/AWa3/CHXg7xCvhjBCwgdm8twrNO pQ4AsdsoVQPDMlJQdAdZ/uODYIs9fXJyRAa0m0GuE6SWkeBy7qiFjs2sDEXdTyNeD+C/JqECdPj gVMAjIaQhnuGv9Mv7uZVWlRPjYyfouPuietHw7lON6dXC5DwUuHGuLpdXKNQDSTdar4qkbxNKos EHkUjYPDYc7cyh03oSfz/NZ/EhYeI4SiKzHQa+gCSF0dSfPN/F6ZbriVPb17BAfUtRgoyRmg+9q hyIVhIpYD9AWXvodi08OtCqzR4pkjQI7LLHtEXLOrEtmDCVT+ddc79dUf9mHZG3yNVnhPf+CMtM yx/qVD0PCmtsFmduU/DC+8mpnf4obNOd3v1 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: rust-for-linux@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