Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp871692pxb; Tue, 1 Feb 2022 12:08:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrXnyw6TtUQb2+jcRNLM18BXirHt4ofqLM1NYQpDEh191dDxqIpRW9gsHuXSEdMXwSHWn3 X-Received: by 2002:a17:902:f54b:: with SMTP id h11mr27258584plf.91.1643746139037; Tue, 01 Feb 2022 12:08:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643746139; cv=none; d=google.com; s=arc-20160816; b=bqYMRYf/hKg2ywUkoTwcYS1RKf9Ux9ka8wPF3yLUmFAEUz2GuElBnxyVto21IsAKfz d4Lu0K+DnwJzaRnQqVq0AzxAKM1O54jjk02oi1+qKp5iOFhGjunoHgj4Kzy55DtSY6yr REMwBQ8rKpMqRrXU/F+6dbXpJgAqxKv585N9wDvHov3uidgi2gricJD24oHD8r3m3kAG T7NkEBinBhYb0NfCFKO1uZn9ym6J5y0WnPOvERSymTJ7eZpGDL/G3fWCyVcI8hAmOBA0 jwLMTTEiAB5QHJDSBGVNxSxwj9Yuu1YnRACzwjASZxUqUanRZ8wE5LZVoYjgbvCNC2K6 Q0Cg== 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=sYDzy2+FWHvZjGF1ZM1yXabzTnyO/OZohCGCbGfHBsw=; b=joJjohu8kBd0xe6opfFow1j1vLOVsIprTxrWXqOSZDAeSJjaFE+2IboA+TIu6/KRkI NshTo2fvNwdeffLFD1BuXaiHDPf8HLHO0OvJvPOlT+A9ME871CLe5b+YpqQxMAO8Jyji fryKQFun6g7w1t8J1pUDLySJd3Cq6bFQIvTI+nbEzuZvzkCgkYsW0BMQugXzacBLpm63 8rShElylTuRaiXsfy6JuOmjhPt2L25T3Ow1aYyoVzSGFc6JHd+mcEUUrBPItiiDPxrag phdoLuwF13UdEfGxnGguvtWNLIhksiOj4MyG3VRZAQaE9cWrIMK4y36vCSKoeOf33pS4 +ZUA== 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 be8si17830672pgb.37.2022.02.01.12.08.46; Tue, 01 Feb 2022 12:08:59 -0800 (PST) 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 S1378913AbiAaL3e (ORCPT + 99 others); Mon, 31 Jan 2022 06:29:34 -0500 Received: from foss.arm.com ([217.140.110.172]:47680 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378380AbiAaLUG (ORCPT ); Mon, 31 Jan 2022 06:20:06 -0500 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 9BB62D6E; Mon, 31 Jan 2022 03:20:04 -0800 (PST) Received: from FVFF7649Q05P (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E600C3F774; Mon, 31 Jan 2022 03:20:02 -0800 (PST) Date: Mon, 31 Jan 2022 11:19:57 +0000 From: Vincent Donnefort To: Yury Norov Cc: Thomas Gleixner , Peter Zijlstra , Valentin Schneider , Ingo Molnar , YueHaibing , Yuan ZhaoXiong , Randy Dunlap , Mathieu Desnoyers , linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kernel/cpu.c: fix init_cpu_online Message-ID: References: <20220131014648.941629-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131014648.941629-1-yury.norov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yury, On Sun, Jan 30, 2022 at 05:46:48PM -0800, Yury Norov wrote: > cpu_online_mask has an associate counter of online cpus, which must be > initialized in init_cpu_online(). > > Fixes: 0c09ab96fc82010 (cpu/hotplug: Cache number of online CPUs) Aren't the increments/decrements from set_cpu_online() enough? I guess we could argue that this isn't a private function and the num_online_cpus should be updated here. But unless I missed something, init_cpu_online() is only called in ia64 arch, in the !SMP case. Is this the problem you're trying to tackle? If not, I'm not sure that warrants a "Fixes:" tag > Signed-off-by: Yury Norov > --- > kernel/cpu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 407a2568f35e..cd7605204d4d 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -2616,6 +2616,7 @@ void init_cpu_possible(const struct cpumask *src) > void init_cpu_online(const struct cpumask *src) > { > cpumask_copy(&__cpu_online_mask, src); > + atomic_set(&__num_online_cpus, cpumask_weight(cpu_online_mask)); > } > > void set_cpu_online(unsigned int cpu, bool online) > -- > 2.30.2 >