From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9654ECAAA1 for ; Tue, 6 Sep 2022 15:26:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239708AbiIFP0k (ORCPT ); Tue, 6 Sep 2022 11:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239510AbiIFP0N (ORCPT ); Tue, 6 Sep 2022 11:26:13 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDE61BFE99 for ; Tue, 6 Sep 2022 07:37:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nGbmOt5qy6TtbRFBf3a33ifWuRBuC92wFOBE6Y9UGY8=; b=sZEcCcyvLBfpVsh1VqMtAebfcn /ZO+fsyVSLofYcDi+RB4BzURacE+guSMmhUVPf5FVg2qV4FpGBhQYvtJh3X2+V/g7YTFlDsPXC7yM RacspXu1s2GhpS+VJKoIc20myDCELKyki7SGc7HR5HcRXcbYdJYM15q+ia2vYkCnEStgiTWUK8qeP EKRtXLNVZwHxrWQ07gppnxo0jPHgT9IvE+oLrZFyDEmytzwNGmEiZJg3xAPz0F/0cK4BDnqIdLULC dAGtYhPqqCCAxPve8WDovQxM7rP6/5QOp0TFEFWPe4Iu7nZCsfkzgsQosxQTKfyQ66b+qwd6Uf/oX sVPdOGlg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVZgz-00AVAC-2X; Tue, 06 Sep 2022 14:36:45 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EDFF7300023; Tue, 6 Sep 2022 16:36:39 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7B79C2012A05B; Tue, 6 Sep 2022 16:36:39 +0200 (CEST) Date: Tue, 6 Sep 2022 16:36:39 +0200 From: Peter Zijlstra To: Yury Norov Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , Rasmus Villemoes , Andrew Morton , Stephen Rothwell , Thomas Gleixner , "Paul E . McKenney" , Vlastimil Babka , Dmitry Vyukov , Valentin Schneider , Sander Vanheule , Alexey Klimov , Eric Biggers Subject: Re: [PATCH v2 1/5] smp: don't declare nr_cpu_ids if NR_CPUS == 1 Message-ID: References: <20220905230820.3295223-1-yury.norov@gmail.com> <20220905230820.3295223-2-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 06, 2022 at 07:06:31AM -0700, Yury Norov wrote: > On Tue, Sep 06, 2022 at 10:53:53AM +0200, Peter Zijlstra wrote: > > On Mon, Sep 05, 2022 at 04:08:16PM -0700, Yury Norov wrote: > > > SMP and NR_CPUS are independent options, hence nr_cpu_ids may be > > > declared even if NR_CPUS == 1, which is useless. > > > > I'm thikning you're fixing the wrong problem here. > > I'm removing dead code. If NR_CPUS == 1, nr_cpu_ids does exist, exported > as an interface variable, but never normally reached, because in some > other piece of code (not even in smp.h) it's declared conditionally. Can't you simply disallow NR_CPUS==1 for SMP builds? It doesn't make sense anyway. > > Why do we need extra source complexity for this? > > To have effective code generation for UP builds. Again, who cares... isn't it hard to find actual UP chips these days? It was suggested the other day we remove a whole bunch of SMP=n code and unconditionally use SMP code, even if its pointless on UP just to make the source simpler.