Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2195391pxb; Mon, 12 Apr 2021 17:35:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydO3m+tfl3oFAj3AP4NAglUrDIr3Wnwd6WzsX18Lyco2l2S9n5sUQTVgaIu5IEb/KFhZDh X-Received: by 2002:aa7:cc15:: with SMTP id q21mr32705965edt.140.1618274130069; Mon, 12 Apr 2021 17:35:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618274130; cv=none; d=google.com; s=arc-20160816; b=IoiyqyReYgJKnPJTi0WNT3Gm3n8qEqYQazSFfYiBoz08N77o6LmAbL78KsBmIXjFq4 iC+8BGdBw/cm9AmRPBn8+03hGm3oySmW0RWcfVG0fqS60hMx3A+huMb4cdtBTjTd+t6t QFDKzu3c86NXad7GUnjRofMWJw//3DMdjD2yBPZEVJ7XrACrgn9PHo1lbsaZTYj0FGqg qfQ0ZO2NJMEo3yLXOdQQjYrvWXwmow+BeAFChc+jl7vD7q7i6CV6/WJnecOfDHQAl1qg O6COKbJXT6Ze7D35kcg4tLlPcLweBy+MB/ps3WdoBHJ/EM1pxKvc86CV8pWi35N7oZAs lZbg== 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; bh=D4xgfUUve664oviSpMdTVyXnvQZTXCPl8b+pqwNqUdo=; b=FJMmCxfPwf4T9WnHD8RkgpBPS3Ftj49S+lCmoEPM/CdebEKLoGPEn/Y6nkfdUtRl4a yUhqAm4/OkBjAL7b6CejZ7Qe5Lk9nUUR0xrRo4ldVy9FUzjFlBxgzGiTo/difZ8CSKbN WtjxkBhtJYG2K0ad/EsrdV+NuUEoNz402xNDsz6Cj5mk2k/+7FZGiRbn9j7+yHB/E6Ba yAVIY0hOPlj76ACuAEEPfQHK6mBxrNG3Z9yDqvQLyQmAAwf8LrthiNgqqJ4SETAFSGVc p2pwywrqzws5dkz1op87PH9/OFhHXJMJE5kJRMkiCfpFMG387tUr/IQ0pwwGQG+hYon8 kfZA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si8061507ejj.746.2021.04.12.17.35.02; Mon, 12 Apr 2021 17:35:30 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238696AbhDLLRU (ORCPT + 99 others); Mon, 12 Apr 2021 07:17:20 -0400 Received: from foss.arm.com ([217.140.110.172]:47202 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237930AbhDLLRT (ORCPT ); Mon, 12 Apr 2021 07:17:19 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CC06131B; Mon, 12 Apr 2021 04:17:01 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3D783F694; Mon, 12 Apr 2021 04:16:59 -0700 (PDT) Date: Mon, 12 Apr 2021 12:16:57 +0100 From: Qais Yousef To: Peter Zijlstra 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: <20210412111657.hu7hbaay2zxzdxm5@e107158-lin.cambridge.arm.com> References: <20210310145258.899619710@infradead.org> <20210310150109.151441252@infradead.org> <20210321193037.7o3mqcmwjthbos7n@e107158-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/12/21 12:55, Peter Zijlstra wrote: > 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); Slightly better I suppose :) > > > 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. True. Beside I doubt there's a performance hit really, cpu_dying() will read the bit in the cpumask anyway, unconditionally writing will be as fast since both will fetch the cacheline anyway? Regardless, not really a big deal. It's not really the hardest thing to stare at here ;-) Thanks -- Qais Yousef