Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp338841rdb; Thu, 19 Oct 2023 06:10:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5J5zFr3jONNw3LBnG+ZkPoSV0f7mmIqcLlgnCjBBASvhN2GKmmAoDcgvquo3lvjcGVBKv X-Received: by 2002:a17:90a:4a8e:b0:27d:1b04:d69d with SMTP id f14-20020a17090a4a8e00b0027d1b04d69dmr1740280pjh.35.1697721050167; Thu, 19 Oct 2023 06:10:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697721050; cv=none; d=google.com; s=arc-20160816; b=uBMJs2QlbrkzfdeVLmV9BDeDMQ/Du0Kh77LvqZFMvaQbWQUS+QYqiS+orP/t7b71uc Vel8BymXOkHKjqQHxKyTucAjNJ2jUiYRcBcBb3IxJ/i5vymQXdyAPFnvDmIZpQtKL8Um 3ICdeZvGGtpo+xYfAiZ5rXGjd+JOhPbWmy42ltkmozqblWBJnBih5ax2yriTKCEOsgHL zBgGBxA6pJJunu6GyuqcWqzNoMqp2G79gG8eAZ6KcakCRfHa828dISasSgBGGw2tUn8p omCLs3HbHlXpsccvsPjMry7Mo8bq1zswjPC27s+xiveGx1PYX1s5iHnG0v6bCuSeotLP pKJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wefq5l/NfyiUOh2/K3hLXsYdyjlw2nsfgUdvc6uHmaQ=; fh=usil+xGGZm+S3deGgaIN0xD4myp1tpde6pfrgHdY2zE=; b=Qv7X+IKJP4HtWsq9/GhHdbQWSmRs4Qc0clHNAUy0YBdSsBKBOpRCNcEPOhZf1DdNkS MivXbzhn18CDTCV+gmHFIc/47pjJf6WM3P4CPQa4wh7ixlrurfBjc458WCsNqfWdtNw6 fJozkIyaQKaMQ60HWHB3zgZEPdbUJNUVGAqyKfZWxo8+2Z/wg8h48WcxvIpaagLWwK7K IIcpCJ/9a6e6mbWW5s6S/vakG81dIdkhfIEFU88UlI5Y4EGQOkesA6+PMuFULOaLzzrC v1MU6oaBuAvEkt794NwJ9FAkMlu353pBRGHMAFJb44y3fwe1Tm52Noryy59rRILcx37Q aNUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=VU0RxPDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id e8-20020a17090a77c800b0026b698fdda6si2019285pjs.98.2023.10.19.06.10.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 06:10:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=VU0RxPDg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 3FA3780E6695; Thu, 19 Oct 2023 06:10:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345699AbjJSNKR (ORCPT + 99 others); Thu, 19 Oct 2023 09:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345837AbjJSNKD (ORCPT ); Thu, 19 Oct 2023 09:10:03 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6222189 for ; Thu, 19 Oct 2023 06:09:06 -0700 (PDT) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39JD5pnw022703; Thu, 19 Oct 2023 13:08:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : reply-to : references : mime-version : content-type : in-reply-to; s=pp1; bh=wefq5l/NfyiUOh2/K3hLXsYdyjlw2nsfgUdvc6uHmaQ=; b=VU0RxPDgFnJIB9glY0+FpWzyhm0tw+o/UmuH//TM0WfFCSGo+/s3Juz4nuiNlEkkjF4c Y1vrRtrUJQPgEWoXjIZkCi7w+ig5iCN5FDk2YeQNH/jxosmlWn6qO5D7mTovlbu27D/U MEe/RFU8N+ylgffyGx2mIpZycrlsWSm1as9y/CPr7Le/0AOmeE/jz26zDqBgcmn2ZVrp zBGfopV7+3kAxvQEo0oQy1Z9GGWCFNMKiPZHS912RaIzL9Qj6b0jo+8AN1ggDuWj+zeQ vXT5nGaSvM8uzcHbn59Rfk5h9Fj+z8DfyFlZ7qEYp6GqpUJmveawHutekVAUqfdW4VX4 qA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tu51nr7f7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 13:08:51 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39JD6NIw026640; Thu, 19 Oct 2023 13:08:50 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tu51nr7dy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 13:08:50 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39JAF9GS019900; Thu, 19 Oct 2023 13:08:49 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tr8120evx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 13:08:49 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39JD8ll344302644 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Oct 2023 13:08:47 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88C6320043; Thu, 19 Oct 2023 13:08:47 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DFB420040; Thu, 19 Oct 2023 13:08:44 +0000 (GMT) Received: from linux.vnet.ibm.com (unknown [9.126.150.29]) by smtpav07.fra02v.mail.ibm.com (Postfix) with SMTP; Thu, 19 Oct 2023 13:08:44 +0000 (GMT) Date: Thu, 19 Oct 2023 18:38:43 +0530 From: Srikar Dronamraju To: Michael Ellerman Cc: linuxppc-dev , Christophe Leroy , Nicholas Piggin , Peter Zijlstra , Rohan McLure , Valentin Schneider , Ajay Kaher , Alexey Makhalov , VMware PV-Drivers Reviewers , Josh Poimboeuf , virtualization@lists.linux-foundation.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/6] powerpc/smp: Move shared_processor static key to smp.h Message-ID: <20231019130843.GI2194132@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <20231018163751.2423181-1-srikar@linux.vnet.ibm.com> <20231018163751.2423181-4-srikar@linux.vnet.ibm.com> <87sf675im3.fsf@mail.lhotse> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <87sf675im3.fsf@mail.lhotse> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: aU8TME1IjwVF9r22d_NEiqeu4_u4_b1W X-Proofpoint-GUID: 27h_Y8VBQgPyYVsbJj6D0z1NkvNofouQ 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_11,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 mlxscore=0 suspectscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=793 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310190112 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 19 Oct 2023 06:10:30 -0700 (PDT) * Michael Ellerman [2023-10-19 15:41:40]: > Srikar Dronamraju writes: > > 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. > > I'd rather you just included paravirt.h in the few files where you need it. I thought, detecting if a Processor was shared or not was more a smp/processor related than a paravirt related. Will drop as suggested. > > cheers > > > 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; > > } > > #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); > > -- > > 2.31.1 -- Thanks and Regards Srikar Dronamraju