Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3064150ybb; Mon, 6 Apr 2020 01:01:52 -0700 (PDT) X-Google-Smtp-Source: APiQypLq7dTh5XcHf218gPMxHyF0m3iA4B2idSwh9qAUkVIGI+4nWX566DaZ9ZFfcMF2nthdippW X-Received: by 2002:a9d:30c7:: with SMTP id r7mr16364302otg.289.1586160112125; Mon, 06 Apr 2020 01:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586160112; cv=none; d=google.com; s=arc-20160816; b=ilM8s2vxiZ8Xi3Y5zAtx3vQ5uV1UAaJZ6Lyqu9yCrzX3KwKhksZyKtQXTk9ioWA2SP JBAIXRD6OAho+yUftnDfqajWOnEskSrL/HLM8I/51eQm1VuLyPQxFsxiJIbVzvcygwCd 9XR57RnVDoXBgELkPXdkmF4SZ16LCpGmpiNQL4sKw9nx+EfZffnl1PNl/IhGb0xcNDu2 odXhHNj7/EUA+GzACSVG92ktj4sUMfxugDxKAcSYyyjzRAySaRRSmQW6V9Y/uPow617f nXq4LvCSzS4DWBvFDRGMg3vO3TpoanDRcLUtlzFn3i1mESidRmbph/xf3P84GDjHZHq4 HFCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=XtZgvziAgeSrDz12Y3oJZjZbmUtUFfr3baGwPFvcsJM=; b=TMyAxy39IgYGr9VKnpuu5V49VLsTAQxO2W6OJay6iroz450giNNpj9OXM9+KSC6lEl X38Ii+PB2CGjb2mRpDbkadOC1BpFXlMELSbdFRbtqBBq1zGEES7xoHfx64Xl484aGhyZ rxjjw+08wwQ0avUlkBeMXBS31HufjfeWHlliwnTj7p4VkAQYqko+f4qJ/2FERekM241P 3jyxbiPGNYYgIioXbDAAOY47zdI2uYtveNN4cbJJndnvBMBhvOQe9gVulAAKzCQwqnJ6 /D91BC+/DY/4LiHAFgHCIkzO3oU2gOI3CwOkVNs8i7Y4DvbMjvh9StoC61NmrsNvvIrp LmwQ== 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 m126si7310216oig.177.2020.04.06.01.01.26; Mon, 06 Apr 2020 01:01: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 S1726535AbgDFIAw (ORCPT + 99 others); Mon, 6 Apr 2020 04:00:52 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12680 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726475AbgDFIAw (ORCPT ); Mon, 6 Apr 2020 04:00:52 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 79FAB66759F3822586F4; Mon, 6 Apr 2020 16:00:44 +0800 (CST) Received: from [127.0.0.1] (10.133.217.205) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Mon, 6 Apr 2020 16:00:35 +0800 Subject: Re: [PATCH] sched/arm64: store cpu topology before notify_cpu_starting To: Valentin Schneider CC: , , , , , , , , , , , , , , , , , , , , , , , , , , Sudeep Holla , "chengjian (D)" References: <855831b59e1b3774b11c3e33050eac4cc4639f06.1583332765.git.vpillai@digitalocean.com> <20200401114215.36640-1-cj.chengjian@huawei.com> From: "chengjian (D)" Message-ID: <9686e37d-5698-334d-5e23-70a1e2d804ec@huawei.com> Date: Mon, 6 Apr 2020 16:00:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.133.217.205] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/4/1 21:23, Valentin Schneider wrote: > (+LAKML, +Sudeep) > > On Wed, Apr 01 2020, Cheng Jian wrote: >> 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. >> > I haven't been following the sched core stuff closely; can't this > rq->core assignment be done in sched_cpu_activate() instead? We already > look at the cpu_smt_mask() in there, and it is valid (we go through the > entirety of secondary_start_kernel() before getting anywhere near > CPUHP_AP_ACTIVE). > > I don't think this breaks anything, but without this dependency in > sched_cpu_starting() then there isn't really a reason for this move. Yes, it is correct to put the rq-> core assignment in sched_cpu_active(). The cpu_smt_mask is already valid here. I have made such an attempt on my own branch and passed the test. Thank you.     -- Cheng Jian