From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4CA52C282CD for ; Mon, 3 Mar 2025 14:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:CC:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+NvbYf7uxpFxnfAxigPzbutqxrbeU3zLcuZDwWkiTBE=; b=XO/0mQwS/KkB/43LQhtocSs1WM vQ2NfdWxODyKgMiD91PNn8Du9ZJVpCK2GTxz/E6dRGUkx24tvK6eNWiDUS8lEWVXy0lZuJMaA2THk SnAtd6IxHaj7eRZnWtSEQliJ9ZR8caggjGMcjbpI92rZVO9K+E6TN77jlGeKARx4ibse9FKjTJ9e/ /dmXIM4BTt4kTxNjnNZSbGxaeRJVphiW1NSZr3nBXK6cp+5ziHB7BKrN6FgZHgDqfgwFYkTZMEG7E Z0cQYM8m/N/gGmki4xFySBlRCplCskH+Xfv7cHlCXhZiT4wKpTcpAfvviJt1csEDAiXkEzHeARDMt 8xhXU3cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tp6OY-0000000115r-2l3v; Mon, 03 Mar 2025 14:03:46 +0000 Received: from szxga03-in.huawei.com ([45.249.212.189]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tp5xR-00000000wVT-3Coa for linux-arm-kernel@lists.infradead.org; Mon, 03 Mar 2025 13:35:47 +0000 Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Z609V2G7zz9wF9; Mon, 3 Mar 2025 21:32:30 +0800 (CST) Received: from kwepemd200014.china.huawei.com (unknown [7.221.188.8]) by mail.maildlp.com (Postfix) with ESMTPS id 6A48E14037B; Mon, 3 Mar 2025 21:35:37 +0800 (CST) Received: from [10.67.121.177] (10.67.121.177) by kwepemd200014.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Mon, 3 Mar 2025 21:35:36 +0800 CC: , , , , , , , , , , , , , Subject: Re: [PATCH v11 1/4] cpu/SMT: Provide a default topology_is_primary_thread() To: Dietmar Eggemann , , , , , , , , , , , References: <20250218141018.18082-1-yangyicong@huawei.com> <20250218141018.18082-2-yangyicong@huawei.com> From: Yicong Yang Message-ID: Date: Mon, 3 Mar 2025 21:35:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.177] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemd200014.china.huawei.com (7.221.188.8) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250303_053546_002644_7D08906B X-CRM114-Status: GOOD ( 13.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2025/2/28 19:10, Dietmar Eggemann wrote: > On 18/02/2025 15:10, Yicong Yang wrote: >> From: Yicong Yang > > [...] > >> diff --git a/include/linux/topology.h b/include/linux/topology.h >> index 52f5850730b3..b3aba443c4eb 100644 >> --- a/include/linux/topology.h >> +++ b/include/linux/topology.h >> @@ -240,6 +240,28 @@ static inline const struct cpumask *cpu_smt_mask(int cpu) >> } >> #endif >> >> +#ifndef topology_is_primary_thread >> + >> +#define topology_is_primary_thread topology_is_primary_thread >> + >> +static inline bool topology_is_primary_thread(unsigned int cpu) >> +{ >> + /* >> + * On SMT hotplug the primary thread of the SMT won't be disabled. >> + * Architectures do have a special primary thread (e.g. x86) need >> + * to override this function. Otherwise just make the first thread >> + * in the SMT as the primary thread. >> + * >> + * The sibling cpumask of an offline CPU contains always the CPU >> + * itself for architectures using CONFIG_GENERIC_ARCH_TOPOLOGY. >> + * Other architectures should use this depend on their own >> + * situation. > > This sentence is hard to get. Do you want to say that other > architectures (CONFIG_GENERIC_ARCH_TOPOLOGY or > !CONFIG_GENERIC_ARCH_TOPOLOGY) have to check whether they can use this > default implementation or have to override it? > yes exactly, will improve the comments. thanks.