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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92B7FC433B4 for ; Mon, 12 Apr 2021 12:49:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AF9A61263 for ; Mon, 12 Apr 2021 12:49:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AF9A61263 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cL6VvS0enbQxusHh03WijmfmmYMLXN1m1eGYMCojIOg=; b=TyCZaSNCIuD8/bgeeNVLaEOth 9GJeer0XcOs2EYfw6qEqe5fQD3zrThMhIJ0oV2o4Zv+mT6mR+0KPmmwESPijSTy1R3Rn51yJo8FWH jByZNIBkUulMjbhYC2ZXTPIyVxSoa0xUvIx2XpjpVpOXn850P9jQOFamdYHsTWz7KUacUCEPv3kZb RsFc7uasqD4sz9v0xn5i3ScHCYXRQAQCxS1Mt5D0rJZsAv+CBp36UYuOrSRP9VS0NLYcyxQFVPkrD BRwny3kQCqnEOvMMtuJmattOp2Jt0H7pgF2bPPOPnQFBY0FWYu+v1CUAwogLzA/R81Cib0xxWQK5U pebnH3/zQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lVvye-006jtT-Hz; Mon, 12 Apr 2021 12:47:40 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVvxk-006jc9-VQ for linux-arm-kernel@desiato.infradead.org; Mon, 12 Apr 2021 12:46:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WM/iOWAjkLXJ/1dPg5/UnoJQcYHhYRAJHb2p6HAYA8w=; b=fWHbeKoy1txq6XFVZpzbxDkDzB RmDw0Wcyte0m/+NTE3E59XvEYCh5tdnWyl5dJcf/amUR1Tux0UO32aa6UI+vM35DZGPBdOgL/0d9f hIuP0iqRaEOoCh344xCQQB4A8Ta4T8u9WuI0abKtIto8Ub/pTKxel3vpFofIit4yU9KHoEMp/aLxU It0M8rpC8BfX7FRfsSrhOpyPohQ+UbxPsrCjH1Yw0hAnUQmQ2229TNx7AfOnNmAiBh8XGbt0fDpVh DTKnRO+W8Ua+7M0+Bxx9RJusn2UD+HHRf2GCStrDKKORrzozbq2xR06tYdLKVp+TUpvW4Zff7Xc4P pI0tA/sw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVvxi-006EUi-Gb for linux-arm-kernel@lists.infradead.org; Mon, 12 Apr 2021 12:46:43 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3517D61246; Mon, 12 Apr 2021 12:46:40 +0000 (UTC) Date: Mon, 12 Apr 2021 13:46:37 +0100 From: Catalin Marinas To: yangwendong Cc: Will Deacon , Mark Rutland , Martin Weidmann , linux-arm-kernel@lists.infradead.org, wanghaibin.wang@huawei.com, Zenghui Yu , "wangjingyi (D)" Subject: Re: ARM WFET application scenario consultation Message-ID: <20210412124637.GE2060@arm.com> References: <26f50e86-dc68-0aca-f29f-19ef2f884c5d@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <26f50e86-dc68-0aca-f29f-19ef2f884c5d@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210412_054642_595797_811766CD X-CRM114-Status: GOOD ( 16.48 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 12, 2021 at 08:08:23PM +0800, yangwendong wrote: > Recently, a new feature of WFE with timeouts has been added to ARMv8. > I have some doubts about the application scenarios of this feature. > > 1) Arm spec said that WFE or WFET can be used in spinlock. Since the > thread using spinlock can't be sleep, if we use the wfet instruction, we > can do nothing but wait when timeout, so what's the difference between > the two instructions in this scenario? Not much point in using it it in a classic spinlock, unless you have some specific implementation that's supposed to time out. Note that we already enabled the event stream in Linux so that an event is generated at 100KHz waking up any WFE. One reason we had for this was some hardware errata where events between clusters were not generated. Another was some small delays required in in certain user programs without going through a kernel syscall, though not sure anyone's actually using it. > 2) Are there any other special scenarios where using wfet instructions > can be beneficial ? In the kernel we could replace our udelay loop with WFIT for example (not WFET because of the event stream). As for user, we can expose a HWCAP but it's up to user libraries to make use of it. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel