Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2512631imm; Mon, 28 May 2018 09:29:20 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpOY2GG/C09RwDO597yNXbVQxDJbsH23BBU7h4na0OwaxtdLC/KPOflUDEaM7ukNHzu9RWa X-Received: by 2002:a62:7002:: with SMTP id l2-v6mr14165857pfc.40.1527524960576; Mon, 28 May 2018 09:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527524960; cv=none; d=google.com; s=arc-20160816; b=f+cfHdld04q6YnIjRQlErDc+WRVdtNJhoZtpVmbbW8TubgpotRixYbmePLEkNe/nL9 BaPhV9G6VuZ7DyhIwniVwE/fbVp6t4UFfPFBbLtaTOBSZN7CJoy1/Fsfs8yoJJ7n3/WR 9vkYv0f6NebMyqh1gJa0v7Wrorp0sI/hvxulJ9aM34Pq9tWOHmuEi3cEUtSuR8notr0n mzqYZ0b+KMmh5UPA44CiQu/PLQ2Rs9moNILoMmdDIvv/tTZeE7xV1aqHtY9tCpoCoCZo cGXjrroGQy4n///lFtMtEkJIqgLOoj66VSPWS2HppdNwscPQjDeQuVUHYeidLjBqOpkw UI4Q== 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=XDj6IVyzO6a6PHN/U6qhW+yWUf+ztmVinACnmOLvd0k=; b=S58MsG9K18PWSnYN+mj6QKPalcq5wcuhpIsc7e+d0LT7u3cFEdheROVmUu+ev3ZGcI r0wGCTEStuiwMN+9MtKc0TyDFcWZHXFYI7Hb33/U+QBs4VZdg7pdlBByhNgoUQMQFeLr 3yKq4QYcC8NwRyWQpbRB/yF7Ltf1cIKX1lXaEvjpGoYnqAj4hyeS7la2I7r3tm8mo2aZ YQH7XuH5JcURJAogJ0ryeFjfFU0NRFfl2+/u4Gt4CmWqGBqpDd0DBhJo6gCV2CyG5KYf KD3WScvwnQOm1aK3Rfc/3x3AqtzJY0mHxOaVF+bGtrZuzo/BBeKyzD883M0VAYBWF9iq heBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AMsZ2XhX; 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 95-v6si31382178plc.383.2018.05.28.09.29.05; Mon, 28 May 2018 09:29:20 -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=AMsZ2XhX; 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 S936438AbeE1KKF (ORCPT + 99 others); Mon, 28 May 2018 06:10:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933629AbeE1KJ7 (ORCPT ); Mon, 28 May 2018 06:09:59 -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 74705208AF; Mon, 28 May 2018 10:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502199; bh=+shb+eWeT5MKQS1PL6nuSa7sx+6PaRxON8uO6FGQSb0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AMsZ2XhXfrZQJfrLdsI0uzmMRfP6aAW3LTcQgt078zILV61MLQcB0gCj8FIM6ieR1 xYJGcYZq4+sDIzUvyts14koUCL5cJemMyVtRAgZrchrP8XqLSvOpSWvREiy9WbKRU/ GO7XyhME5S2gf+S86QK3U3gobAZSpJ2u9V647AQw= 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 3.18 071/185] x86/topology: Update the cpu cores field in /proc/cpuinfo correctly across CPU hotplug operations Date: Mon, 28 May 2018 12:01:52 +0200 Message-Id: <20180528100056.822763067@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100050.700971285@linuxfoundation.org> References: <20180528100050.700971285@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 3.18-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 @@ -1290,6 +1290,7 @@ static void remove_siblinginfo(int cpu) cpumask_clear(cpu_core_mask(cpu)); c->phys_proc_id = 0; c->cpu_core_id = 0; + c->booted_cores = 0; cpumask_clear_cpu(cpu, cpu_sibling_setup_mask); }