Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp263409rdb; Thu, 19 Oct 2023 04:03:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVCXaERPJMIYpWRvoBaFGKJMfsexuVSe9kspWrz6quApjL9PeITYI6lAEjaQDk9X8wccao X-Received: by 2002:a05:6358:facd:b0:143:a15f:65d4 with SMTP id ts13-20020a056358facd00b00143a15f65d4mr1457220rwb.26.1697713399224; Thu, 19 Oct 2023 04:03:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697713399; cv=none; d=google.com; s=arc-20160816; b=KKivsOgWjBYbAqPouC37fYdHm9EfktxVXTJhdllMPHdsgqPhmwxxopeCOMpul+reIO RPPzTR8DnX21hkakn9xhXIJsWRx3L+4thzkFiTIW1blcowSuzzXdKYVoV0HguiNtfmKo IDPjZzMNZ44NcO4oPX4KHaTzrTwLab9w3OqigiwHrulgIHlzvMR1AFKp6AEKzbDUeg8B +7fKh1OB1K2grrHIoNmxaFecnvJHPtzNuC9ZQnISzvlXito7dbvebAzO7kuaPLWc4peb thVrqXARsr/BKV+HslDgO/e4Ikfo6jmQy/SYQN1dZus9JNHy56tKvW19WnuBCuO5kk4e +Wxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=pJKMY/8E3mDP8kAbLi7x+Il6uLPnYOVA9qFZRNYZYmM=; fh=456ivqcYikZCxSkZeQhYxGpksrSMqGAPmVOyK+6uzDM=; b=p0AiOXK0dhQdCB2dv0Uum4MzJZsiyMdMNem/aEn8GAQ2gcAiwkrCdG0Zr5Pcx9+Mqr bXVflPfCnDIq6frTWaH1YRmMkQbjpy0I+eNa76xttBqgYdGaJsKSuMi6pBYNG/++ua3s XkKIvjGJSe8/Q2/HUOxX5RHCtV67E2TlUr8Iufji1xRY8U7BtMsOjWYK2RdkRml2mlUh uHOk1oTXRFNlQlem7RzhPsf1B6Dgjs073D3/h+Bj+GLdBeoCBDlnFAbbsqS7N+QviuZ4 qYVH7eZuQFWXluTRvt/iKZR4c+d95001cM7W8v7NRQkfuLZzso1YJRuMUFf4Mkyam5es qRCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="J0q0YPl/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k26-20020a637b5a000000b00584e05f62e1si4149562pgn.297.2023.10.19.04.03.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 04:03:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="J0q0YPl/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 634568182EF7; Thu, 19 Oct 2023 04:03:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345224AbjJSLDJ (ORCPT + 99 others); Thu, 19 Oct 2023 07:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233051AbjJSLDI (ORCPT ); Thu, 19 Oct 2023 07:03:08 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A7B5FA for ; Thu, 19 Oct 2023 04:03:06 -0700 (PDT) Received: from pps.filterd (m0353722.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39JAxaWT019521; Thu, 19 Oct 2023 11:02:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=pJKMY/8E3mDP8kAbLi7x+Il6uLPnYOVA9qFZRNYZYmM=; b=J0q0YPl/XCkUuaZJApc0ZebTfMAcqfdVcxz9UfquECnqyn2NucOcL41hovRITm0GzTaZ 0HSvKi00qFQ6C+7TGp2g/eZM00J/AeCjdhs7ujfRW7y6PuYft+S+cb4oS1dtcyTU3RJJ 5lI4MMMZbfQwB1aDYK5LKRv3mp/fe/29z8qqMbKp7KJ0glJ3OKmZcPSJw1FyUW20t+nl 5sKh4dP0Df1Nl/bzExv6D8MctMiAlJ8H7iR8smtkT1tWEW3MOPSUOXV9qqFNjy1tCX+4 fMp+B4fhtDBp/C2QK6BpHxiA7h1S8rn5JXZ6ockLWzva9XEsUtQFSW2kqdAxIUxY8bQi iw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tu36jg592-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 11:02:44 +0000 Received: from m0353722.ppops.net (m0353722.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39JB0AUS022046; Thu, 19 Oct 2023 11:02:44 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tu36jg579-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 11:02:44 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39J90BfP031184; Thu, 19 Oct 2023 10:30:56 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([172.16.1.7]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tr7hjysxh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 10:30:56 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39JAUuNW20251332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Oct 2023 10:30:56 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 41CB35805A; Thu, 19 Oct 2023 10:30:56 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01C2558051; Thu, 19 Oct 2023 10:30:52 +0000 (GMT) Received: from [9.109.201.126] (unknown [9.109.201.126]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 19 Oct 2023 10:30:51 +0000 (GMT) Message-ID: Date: Thu, 19 Oct 2023 16:00:50 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/6] powerpc/smp: Move shared_processor static key to smp.h Content-Language: en-US To: Srikar Dronamraju Cc: Valentin Schneider , Peter Zijlstra , linux-kernel@vger.kernel.org, x86@kernel.org, Ajay Kaher , virtualization@lists.linux-foundation.org, VMware PV-Drivers Reviewers , Rohan McLure , Nicholas Piggin , Alexey Makhalov , linuxppc-dev , Josh Poimboeuf , Michael Ellerman References: <20231018163751.2423181-1-srikar@linux.vnet.ibm.com> <20231018163751.2423181-4-srikar@linux.vnet.ibm.com> From: Shrikanth Hegde In-Reply-To: <20231018163751.2423181-4-srikar@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Peq5v0YHO2hZ6VlO4bnzEHl9ORAffMi1 X-Proofpoint-GUID: jHlzS-sO4vRR1-xrqnUfQ2m-K5sqRohK Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-19_08,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=797 mlxscore=0 bulkscore=0 impostorscore=0 malwarescore=0 phishscore=0 clxscore=1011 priorityscore=1501 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310190093 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 04:03:16 -0700 (PDT) On 10/18/23 10:07 PM, Srikar Dronamraju wrote: > The ability to detect if the system is running in a shared processor > mode is helpful in few more generic cases not just in > paravirtualization. > For example: At boot time, different scheduler/ topology flags may be > set based on the processor mode. Hence move it to a more generic file. > > Signed-off-by: Srikar Dronamraju > --- > arch/powerpc/include/asm/paravirt.h | 12 ------------ > arch/powerpc/include/asm/smp.h | 14 ++++++++++++++ > 2 files changed, 14 insertions(+), 12 deletions(-) > > diff --git a/arch/powerpc/include/asm/paravirt.h b/arch/powerpc/include/asm/paravirt.h > index 0372b0093f72..cf83e837a571 100644 > --- a/arch/powerpc/include/asm/paravirt.h > +++ b/arch/powerpc/include/asm/paravirt.h > @@ -15,13 +15,6 @@ > #include > #include > > -DECLARE_STATIC_KEY_FALSE(shared_processor); > - > -static inline bool is_shared_processor(void) > -{ > - return static_branch_unlikely(&shared_processor); > -} > - > #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING > extern struct static_key paravirt_steal_enabled; > extern struct static_key paravirt_steal_rq_enabled; > @@ -77,11 +70,6 @@ static inline bool is_vcpu_idle(int vcpu) > return lppaca_of(vcpu).idle; > } Hi Srikar, This patch fails to apply on tip/master as it depends on https://lore.kernel.org/all/20231019091452.95260-1-srikar@linux.vnet.ibm.com/ to be applied first. > #else > -static inline bool is_shared_processor(void) > -{ > - return false; > -} > - > static inline u32 yield_count_of(int cpu) > { > return 0; > diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h > index aaaa576d0e15..08631b2a4528 100644 > --- a/arch/powerpc/include/asm/smp.h > +++ b/arch/powerpc/include/asm/smp.h > @@ -34,6 +34,20 @@ extern bool coregroup_enabled; > extern int cpu_to_chip_id(int cpu); > extern int *chip_id_lookup_table; > > +#ifdef CONFIG_PPC_SPLPAR > +DECLARE_STATIC_KEY_FALSE(shared_processor); > + > +static inline bool is_shared_processor(void) > +{ > + return static_branch_unlikely(&shared_processor); > +} > +#else > +static inline bool is_shared_processor(void) > +{ > + return false; > +} > +#endif > + > DECLARE_PER_CPU(cpumask_var_t, thread_group_l1_cache_map); > DECLARE_PER_CPU(cpumask_var_t, thread_group_l2_cache_map); > DECLARE_PER_CPU(cpumask_var_t, thread_group_l3_cache_map);