Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp504538ybb; Wed, 1 Apr 2020 04:29:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvLmMMMTocNFbYTAT1nAeRn4JPvlfJfc7IMRrkL18qXoMsh2oJ8awYuNaEQxUX1DloqpKwl X-Received: by 2002:a9d:6a97:: with SMTP id l23mr16168465otq.69.1585740592826; Wed, 01 Apr 2020 04:29:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585740592; cv=none; d=google.com; s=arc-20160816; b=q1aeHJ69oe84QcmZq0z/gRMoyizRDHeHqG1t3Vbpkn1hHwq/IvUKR6kxADtG6iJxkQ Xj6D1ayH3EUKle203eaJgJItC05KHB7ysnH2sWt4yytHpm2VHJLnTfjWwJw8bbtQJjaS mIGiQm5T1ZViZrJdsmPHjZ9uopLZr3ICGtZbXyZBc8+yYddzePNWZJNNP4M8dCTLC5qT 1G7FpAcpWTvetjxcyGtnJL4e5krm1MYu4IEWwC8TsEjcydNxR8CSSMP/G739o7jH5IIw PCAixujg84TqiHQBpPbhasp9q+rM4LWsBC0lWnkFs0qUUq1U6ByjzOXHs8x0Q6wJXelF Ro6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=0N+PBWKhB96L+oHP2PByKHOjQnmTy6eGQhzp61//434=; b=youg8sRsaWWmLc8RHTcQIpzmMcxuIp9QdZfLrYREbrMYKA3b+BSlIk64i75YXsl+bz 0Ij6PDydNQv3fY5r+73nALGzoCC14tPJxSE+P2G3Jiv6SfJEFy95SrWFL1soAHtJKicb wqvtFepaLO14aqnxWsYTg+7AlPu3z8diMaMDf12FelfV828+qcEv1kSQUb6hD7SGx0mW 01lFK8XWSWj64+2ujSIz0xolDSz1aROCzRnrsjsVbQvyqb+h7VgnIz4n4BW7JzIbIZIt tFPwXlNvQaMzyFe5qcJ3bSdj/HFMP5Qpb3pkHr2uJjordqVRoK4P5iOmYsVeaqMpfjsO e+0A== ARC-Authentication-Results: i=1; mx.google.com; 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 d18si762598otf.22.2020.04.01.04.29.39; Wed, 01 Apr 2020 04:29:52 -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; 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 S1732308AbgDAL2A (ORCPT + 99 others); Wed, 1 Apr 2020 07:28:00 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33182 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732276AbgDAL2A (ORCPT ); Wed, 1 Apr 2020 07:28:00 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D3D1850F367A102C20A9; Wed, 1 Apr 2020 19:27:46 +0800 (CST) Received: from huawei.com (10.175.104.193) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 1 Apr 2020 19:27:40 +0800 From: Cheng Jian To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH] sched/arm64: store cpu topology before notify_cpu_starting Date: Wed, 1 Apr 2020 11:42:15 +0000 Message-ID: <20200401114215.36640-1-cj.chengjian@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <855831b59e1b3774b11c3e33050eac4cc4639f06.1583332765.git.vpillai@digitalocean.com> References: <855831b59e1b3774b11c3e33050eac4cc4639f06.1583332765.git.vpillai@digitalocean.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.104.193] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org when SCHED_CORE enabled, sched_cpu_starting() uses thread_sibling as SMT_MASK to initialize rq->core, but only after store_cpu_topology(), the thread_sibling is ready for use. notify_cpu_starting() -> sched_cpu_starting() # use thread_sibling store_cpu_topology(cpu) -> update_siblings_masks # set thread_sibling Fix this by doing notify_cpu_starting later, just like x86 do. Signed-off-by: Cheng Jian --- arch/arm64/kernel/smp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 5407bf5d98ac..a427c14e82af 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -236,13 +236,18 @@ asmlinkage notrace void secondary_start_kernel(void) cpuinfo_store_cpu(); /* - * Enable GIC and timers. + * Store cpu topology before notify_cpu_starting, + * CPUHP_AP_SCHED_STARTING requires SMT topology + * been initialized for SCHED_CORE. */ - notify_cpu_starting(cpu); - store_cpu_topology(cpu); numa_add_cpu(cpu); + /* + * Enable GIC and timers. + */ + notify_cpu_starting(cpu); + /* * OK, now it's safe to let the boot CPU continue. Wait for * the CPU migration code to notice that the CPU is online -- 2.17.1