Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2180595pxb; Mon, 12 Apr 2021 17:06:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHJaiAZVMidn3L53rWW5tY4c8yIaUveIyGPJSJX6QTBXCg1+cU6FT9I8IN4EwFxLf5/4vo X-Received: by 2002:a17:902:7592:b029:ea:d7cd:eb56 with SMTP id j18-20020a1709027592b02900ead7cdeb56mr11991389pll.23.1618272394224; Mon, 12 Apr 2021 17:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618272394; cv=none; d=google.com; s=arc-20160816; b=kpp9+GREtWlOvyIt1Qz+uxZ9HE0hs0Fw+ETwjVz7pFGnCCawANqZmanOfpQxT6MkWn gCQRHVdlCfezFOHHlDQ9+YApN4f5UOnj9DclYN+R8tQG2n50sP637Re+fTahpQtOV7OG wdWHJtONMInqpkyLDeTkWo4eHzFpfjYWB9kdoYKbj+VAdTm2YKUWAtkfEX0yjUKooa1n TWPZC7eR3V1pVPiKdHRSHWhOzks/UCIblpmz8Ktbb4snoxB0muSXCi5B1jc4A8SI0map /GSk4o61At3tTjxsgwrsuao+vBGecmTYc9R6n1Ju54C3hG2oZ9j3bBvBChDNGaVYrAn6 nPsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ys3C0Ut54acSs9l5VxPhbodFpcrmvcx7s05IJDaIX+k=; b=sSrUhkqJ6UruXCn2ySz/IsPjR3b1J+IWPkN2AcDXnvcH+YmNDzGlmP5mtJeFShr+at omlH0kGPsj1ey7Kg4vH+efptAwELhYUSQmKrXbTEiV61a71sjtZe48TMK0cV2FHu3V22 ZCQ9iKWyYu+Y9Ps9Uer1X7CnHUw6dXBALQAyGMhAq5CQIolL6Mj5xrnPk0qQgAHBI0qt xHMtoEqJ9WEX2P7TwXWvp2+6/rDHfjmEpECiGDXvHJx513EolkwIUjgbnJCEMmwWsLhf J2NL3QQnmN92/7shookDmvTuzPtHx9g6NcJ36rdiEhfll8g6g2KX6zPjIAZdyiOBQDB/ us1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vcVW8ir8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si2084397pgp.593.2021.04.12.17.06.17; Mon, 12 Apr 2021 17:06:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vcVW8ir8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239728AbhDLK4Q (ORCPT + 99 others); Mon, 12 Apr 2021 06:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239482AbhDLK4P (ORCPT ); Mon, 12 Apr 2021 06:56:15 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D8EFC06174A for ; Mon, 12 Apr 2021 03:55:57 -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=ys3C0Ut54acSs9l5VxPhbodFpcrmvcx7s05IJDaIX+k=; b=vcVW8ir8krS7ck3GLo60IoPKEL xSg7r6yB5XMPNt6dZRm0SMO7JGQFIeV3LTXOMWtEOOF5NxvLUmjYNDJeT9G9CJRIJNLE8IIJ85NCg sMbuuX+cpMNuIqXrR3xcTwofug16NSre03Kuy5a0j981x3DsDMh2hTXxqCJx8zL7ZR/QIQdGswQ33 sSbYBk4IE9AMWRf9eoqGtivivVz4239y0xOj0OnBAwVR3d0h3WDO2QGl09vW46Zr8RymF5+wU2sP3 NWUTUXmacfo/PGtWlfSENjIBNzGvuldD0oR21Uic7wIis+Qc37RpDg3HZB5K2gBQmYcwMEvvC81W2 /YKVwG8Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lVuDr-004Dhb-Gr; Mon, 12 Apr 2021 10:55:17 +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 (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 881C9300036; Mon, 12 Apr 2021 12:55:14 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4F15820224209; Mon, 12 Apr 2021 12:55:14 +0200 (CEST) Date: Mon, 12 Apr 2021 12:55:14 +0200 From: Peter Zijlstra To: Qais Yousef Cc: valentin.schneider@arm.com, tglx@linutronix.de, mingo@kernel.org, bigeasy@linutronix.de, swood@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vincent.donnefort@arm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] cpumask: Introduce DYING mask Message-ID: References: <20210310145258.899619710@infradead.org> <20210310150109.151441252@infradead.org> <20210321193037.7o3mqcmwjthbos7n@e107158-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210321193037.7o3mqcmwjthbos7n@e107158-lin> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 21, 2021 at 07:30:37PM +0000, Qais Yousef wrote: > On 03/10/21 15:53, Peter Zijlstra wrote: > > --- a/kernel/cpu.c > > +++ b/kernel/cpu.c > > @@ -160,6 +160,9 @@ static int cpuhp_invoke_callback(unsigne > > int (*cb)(unsigned int cpu); > > int ret, cnt; > > > > + if (bringup != !cpu_dying(cpu)) > > nit: this condition is hard to read > > > + set_cpu_dying(cpu, !bringup); How's: if (cpu_dying(cpu) != !bringup) set_cpu_dying(cpu, !bringup); > since cpu_dying() will do cpumask_test_cpu(), are we saving much if we > unconditionally call set_cpu_dying(cpu, !bringup) which performs > cpumask_{set, clear}_cpu()? This is hotplug, it's all slow, endlessly rewriting that bit shouldn't be a problem I suppose.