Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2178211imm; Mon, 28 May 2018 03:19:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo1FDfZOKkV4gSdo+sgNmdFfg7w151LlqqHQTV/MULt/SM+4XYtXTB5X13zINqUfowK7GGP X-Received: by 2002:a63:7a03:: with SMTP id v3-v6mr9827093pgc.285.1527502759477; Mon, 28 May 2018 03:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527502759; cv=none; d=google.com; s=arc-20160816; b=eCKL31M0/SHJARcki28GYTSOgX3b36AYVS+bCb2VfChjPHPOxJ7CeSpaNA/FtaeFT4 MPG441FtXnhOe4sKRxdqdnjvy7yJVcg9BOYSy6P8xuKuRlX7YUYL8FR2thQJ3E792wYR ZfRFqeMrifZkr11yTRLq/clbTF3YkIPk8zcnMtJkmyT74Rx6q/g344hN0IrhTLRI7md/ bCBI5eMJ+mGPK8AAuUaz/b4VCzirTHLXKVCHrMIQCojZz6hDWhLza+AB2GYIud4BEHHs aZbLvTpgll5sacl8qlqIV0Ce5mS/suOj9UFVWCkfop83fJXwxlX97WQXQkSTLKTbcW96 qa6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=FEhjZcCFl7ooYuGJ7V9XT/r6VRln6blEXLx98LZEeD4=; b=NsJWRVaubgj5dPnEe1jsVJ+mHptdpBn0hvtWRXiFDI3VRlVgGs3Lc2Vrn87EHiKyXD IVKhCrwB6OSGN1+Jvbs806JpIVgRfKxtyHrD6lMvYdgEINw2mpLXbGfqkR2cLgJe3MPZ EBufdm/8fMtP8MlBWkhT50KEzX0xxiBFDbW6Sl3TrJ3nDfH/Xkg8C4va02qNIZ5BXD6l xLZtFuH0gckC8fnsvxGow+ejVyyr32NfYGO8iy+BpHW0jDs6uq54gKG0qVpjpznp4Wkj au9K8xLGTyvSZUX3upelt6UGbx5/KkuSaj3qYDSQK19+u484L24CbA0CEtDJvWHdMHjr lpJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BMyEvDTS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v29-v6si29368185pfk.116.2018.05.28.03.19.05; Mon, 28 May 2018 03:19:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BMyEvDTS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031866AbeE1KSu (ORCPT + 99 others); Mon, 28 May 2018 06:18:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:38702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968610AbeE1KSk (ORCPT ); Mon, 28 May 2018 06:18:40 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D384420843; Mon, 28 May 2018 10:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502719; bh=s9A8B7LNQKFLGEWDkg6GzDO1fQxjtjLIEO8/lHAsf8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BMyEvDTS8zgvW3lwk3B2t2aqu/ZMJkw8RZ3psliA5FDbcNsuHZI9wW7rkUxsCmie2 OzFVjVn8OlU+lKAbDw9kYbZ8LFuY7ujGYrOE+h0iuhNyGCVTH7jZGBU2Ep4R/1q0ty jctUGUkzv3+9Nxu2roGb8Utf8rN16NJFqFq/qih0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dou Liyang , Samuel Neves , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , jgross@suse.com, luto@kernel.org, prarit@redhat.com, vkuznets@redhat.com, Ingo Molnar , Sasha Levin Subject: [PATCH 4.4 104/268] x86/topology: Update the cpu cores field in /proc/cpuinfo correctly across CPU hotplug operations Date: Mon, 28 May 2018 12:01:18 +0200 Message-Id: <20180528100213.970408848@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Samuel Neves [ Upstream commit 4596749339e06dc7a424fc08a15eded850ed78b7 ] Without this fix, /proc/cpuinfo will display an incorrect amount of CPU cores, after bringing them offline and online again, as exemplified below: $ cat /proc/cpuinfo | grep cores cpu cores : 4 cpu cores : 8 cpu cores : 8 cpu cores : 20 cpu cores : 4 cpu cores : 3 cpu cores : 2 cpu cores : 2 This patch fixes this by always zeroing the booted_cores variable upon turning off a logical CPU. Tested-by: Dou Liyang Signed-off-by: Samuel Neves Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: jgross@suse.com Cc: luto@kernel.org Cc: prarit@redhat.com Cc: vkuznets@redhat.com Link: http://lkml.kernel.org/r/20180221205036.5244-1-sneves@dei.uc.pt Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/smpboot.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1344,6 +1344,7 @@ static void remove_siblinginfo(int cpu) cpumask_clear(topology_core_cpumask(cpu)); c->phys_proc_id = 0; c->cpu_core_id = 0; + c->booted_cores = 0; cpumask_clear_cpu(cpu, cpu_sibling_setup_mask); }