Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2108409lqt; Mon, 22 Apr 2024 01:22:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNcGSllUHqGQMLvDLPQ5uOK0+rNwvg5y3OAKvsW4wUwS1V3/8SSAtrAVBkFe/gNvDyEarhhZZoSPNWSO1Sx/q2pasddv/wWIMz3EfpSg== X-Google-Smtp-Source: AGHT+IEc+vKFSsckkwdfIgvEQ5N8eJmyQZWWcfe0dEKDHOg16iSZ5bq3mwZPFtkxYRZYhgZitZO9 X-Received: by 2002:a05:622a:453:b0:42e:e489:ad31 with SMTP id o19-20020a05622a045300b0042ee489ad31mr10371564qtx.51.1713774165175; Mon, 22 Apr 2024 01:22:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713774165; cv=pass; d=google.com; s=arc-20160816; b=gYxUEzziAbC0IkteEFUzeciJgItdKA01s92H9mDlodq777l4xmKkT0Kf3q7vN/3pwn D63UOqqTiPrfi6JGMh6LWdwfSTOZcXh7RgOujShSfa3X9+r6LzGeVgn9a0Wszv6SqTDw 6RhCLN/AbzCZyVT4dZy3zru+EorA2aK/iZn7tUnBUiyHjB5dNZ74hmnPRrzEiP2Kvgoe rGq2Ms3ZFH7wnp46TyL7bncwYA+OHKnenlLg7rAJvXhVMwno8OXVn7Gq0LU/E2ThLr15 AColYS8gUr5SO1OlYuPXJ391CgDtohPJGCNoDSAZ0hLJiV0p3BqY04GoNjDXqm1FdUbh ftdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pED1J3cXsow1BOPVHnp+UNn5PxwFYnrEod6ED0PoJOU=; fh=UxtHj2wFHfMwKmpmMFU0t0rQnjRBUopXDUH6i3avB8U=; b=akHUfNUUWIbkWjBFC47wK3bwJ81QlPWIOcb/zwZkJvzZQdshG9ALmDM3ArOWsdEhaP OyuKZRoz5cDS21UOT56TqR9G22CFr20sieOkMoypKaULRTjDitduO1zc9v0dK73rJF9+ NJAImLUX0jrOqY1hKKVF7DcwCfwHZMD0BxlAajsPToMSqirrSphiGuQuWuJYCFkWkKUG jn452A2V2wI49AmrKAImDB/SOku0ubJeA3Ov3ZxOh1ayVfZp/miaoSa5V4qvtQG3s/uM ntNXwudTxduD/E77hDIIa24dBSZ7wehxniKihfyuimUgoqqoxwJ83MsE9hnYjpQjQ45d gH5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=0Bm2NM0N; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-152966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152966-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id v17-20020a05622a189100b00436adb6885bsi9701835qtc.236.2024.04.22.01.22.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 01:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=0Bm2NM0N; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-152966-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152966-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E0EEB1C20DB8 for ; Mon, 22 Apr 2024 08:22:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5017A5027B; Mon, 22 Apr 2024 08:22:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="0Bm2NM0N" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51042482CA for ; Mon, 22 Apr 2024 08:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713774158; cv=none; b=XgOm0BBVmfySSp6GF0s03WDZk6+aOYMWIOQPa4HvrREYZcWklM3qikrLaBO8osh1qn7iUget70iaNohwYvcwTQJx+JhjEFz1J0nW+dNcEJNIed08fUAZnZ1ZYVJtfqOaSXTg1bFq+xEvhCS4pYaITIL8Mrnrg9NpD38HAuZDTRI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713774158; c=relaxed/simple; bh=hqzjZdrVT+2K2Gd5jHuwZTTR/Vs/MX4XtZ2J7V6NUU0=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gHDLpFFgZ4Djp6GmMKRIh5eQQz3h7lvQyR28J8R554ti6MbNjjkbAbfraQ5hfA4NqrzJHYrXg8MWfFhrNx7oQToBYeBD5ZuTajW1IlQhc7LPLWMmSFiOCL0gXxON6mcpcQHn5oERXlKIEp+OQVyOoxxMzjqKSTsiNoaUrF2+cQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=0Bm2NM0N; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1713774157; x=1745310157; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hqzjZdrVT+2K2Gd5jHuwZTTR/Vs/MX4XtZ2J7V6NUU0=; b=0Bm2NM0NU2QjlLM5yB/2g39PUlEsc4G3Lkaq7X1E+M79spPc7Q1ipFYg UZ0l5U2T+F8o5yyZaHFsLjQZiOaaEQ6TMcvnZOLw8Eb7qi7MLnhsJNtwp CW7sqYNHKuG6V7ugKuLmThTbVcGPq784Kmg1VuaJEN0OfhXbg5+I68aiu weu4plm2JD8n/q571CNJa2aENe3UWrlq7rWzQILdDSbuOc4x24koHzlFU Dl9Gx2lPS+jHzw1jJpMvtPczaYfK9n2GpswPoOcL6pDUYtxw/ILvN8ZAY k0mJTzoJhFAVtVDKrZEdXZVYSn2eUjPs3qP9w7mTjOfjkm1XZMOwpYxY2 A==; X-CSE-ConnectionGUID: FFRa7jbjQ4CieqJWuyjLYg== X-CSE-MsgGUID: +MO64W1yTt21mTVIuKugwQ== X-IronPort-AV: E=Sophos;i="6.07,220,1708412400"; d="asc'?scan'208";a="22079780" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 22 Apr 2024 01:22:35 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 22 Apr 2024 01:22:16 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Mon, 22 Apr 2024 01:22:14 -0700 Date: Mon, 22 Apr 2024 09:21:58 +0100 From: Conor Dooley To: Xu Lu CC: Conor Dooley , , , , , , , , , , , , Andrew Jones Subject: Re: [External] Re: [RFC 1/2] riscv: process: Introduce idle thread using Zawrs extension Message-ID: <20240422-dropper-subplot-efaa833f3cf2@wendy> References: <20240418114942.52770-1-luxu.kernel@bytedance.com> <20240418114942.52770-2-luxu.kernel@bytedance.com> <20240418-dove-deferral-2b01100e13ca@spud> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="au03+AdWTr1KTcof" Content-Disposition: inline In-Reply-To: --au03+AdWTr1KTcof Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 19, 2024 at 12:14:47AM +0800, Xu Lu wrote: > On Thu, Apr 18, 2024 at 11:06=E2=80=AFPM Conor Dooley = wrote: > > On Thu, Apr 18, 2024 at 07:49:41PM +0800, Xu Lu wrote: > > > + The Zawrs extension defines a pair of instructions to be used > > > + in polling loops that allows a core to enter a low-power sta= te > > > + and wait on a store to a memory location. > > > + > > > + If you don't know what to do here, say Y. > > > + > > > config TOOLCHAIN_HAS_V > > > bool > > > default y > > > @@ -1075,6 +1090,15 @@ endmenu # "Power management options" > > > > > > menu "CPU Power Management" > > > > > > +config RISCV_ZAWRS_IDLE > > > + bool "Idle thread using ZAWRS extensions" > > > + depends on RISCV_ISA_ZAWRS > > > + default y > > > + help > > > + Adds support to implement idle thread using ZAWRS exten= sion. > > > + > > > + If you don't know what to do here, say Y. > > > > I don't think this second option is needed, why would we not always want > > to use the Zawrs version of this when it is available? Can we do it > > unconditionally when RISCV_ISA_ZAWRS is set and the extension is > > detected at runtime? > > > > Cheers, > > Conor. >=20 > Indeed, we can always choose WRS.NTO when entering idle. >=20 > This config is introduced for the second commit in this patch series. > In the second commit, we detect whether the target cpu is idle when > sending IPI and write IPI info to the reserve set of idle cpu so as to > avoid sending a physical IPI. Besides, the target idle cpu need not to > go through traditional interrupt handling routine. However, if all > cpus are busy and hardly enter idle, this commit may introduce > performance overhead of extra instructions when sending IPI. Thus we > introduce this config just in case. Could you add the downsides into the help text of the config option so that people can understand why to enable/disable the option? Thanks, Conor. --au03+AdWTr1KTcof Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZiYeGAAKCRB4tDGHoIJi 0m0oAP9mbUm3LJcEUiHU1xnlWcY7C/VC+9g67Mo9ZUgSpFCQPAD/S4i9UUubWIEX UgTIDTA4/zvViKNIYF6pSKiRQV8URQ4= =Ocef -----END PGP SIGNATURE----- --au03+AdWTr1KTcof--