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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 9D71CC433ED for ; Mon, 12 Apr 2021 13:10:45 +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 196A9610CA for ; Mon, 12 Apr 2021 13:10:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 196A9610CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:MIME-Version:References:In-Reply-To:Subject:Cc:To: From:Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=46TqOkCyFlEi6vlO1IcEQbdTavg7lVXPCs9NpIqyMZk=; b=HzZXz6V1k55jY6tIjY8nDkcU5 bteoURrtU0N+pYQ3ACmWBDeKYIfaEzt8DdPV9Mg7firiyQBBGDcWoUu20IIO0l0qjmbZbDrhOTB9S +dWg5PMwerbJE4sH9upKcUcIJscJAhf1/dfXZLrNeA/91I2jmXiumHFU+wGrM+pvTy80xaVGktXee /U8ohcpLSIYx8G+zPmHRZsbKA3cS5oMuFxpLV1F7+dAGyNeg0sS0tKaTPC08xoFjFfzd8O5HqQWJF 3+4nQw9rk8pPXNfu3AJdJCpc2WBYJXPiQSzx5v3CVAdI8nt6ljNQtpvMLZY9KjvRb22vOIH0ge+YG 8LBchgyYg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lVwJb-006mlf-2I; Mon, 12 Apr 2021 13:09:19 +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 1lVwJY-006mlJ-HH for linux-arm-kernel@desiato.infradead.org; Mon, 12 Apr 2021 13:09:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:MIME-Version:References: In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YhqFAuhNI5LRx1+pYJD+UDG8U4ni4jln6PG/u3qiwRM=; b=rKKfqdA8z1RfuDM2Lz3jY4ZDjl 42Bmt/EvfbIMN1GFlpOTBDN3odrukmxfomUF5n2SkhsXh4OYJaeJkkXKa+0qqdtoXFMa3dgMNkQgc 4F0JHte5qwxEu1aWIsBQc6LKYVN5wMrWgqqBidyy7z3F1rBiStrYkDiXNRsufhi1X1bCm69RjX17s If3iKDYzbWlePlQKO8tGycmIKPPatVyNGXWtqg1yysgaOxnmT3ER5WArIi8Ru2ymw2QQafHcTN7vC k3mbIoMKrzv6ZpWzxlc+ahVXXLIwaTZPkaQPMWvBEB51U1V70sqVBkVfA4l9s2cnlaQADml8G/hKa HOnZUMjQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lVwJW-006Fam-06 for linux-arm-kernel@lists.infradead.org; Mon, 12 Apr 2021 13:09:15 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85EE46128C; Mon, 12 Apr 2021 13:09:13 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lVwJT-00715W-FP; Mon, 12 Apr 2021 14:09:11 +0100 Date: Mon, 12 Apr 2021 14:09:10 +0100 Message-ID: <878s5nodjd.wl-maz@kernel.org> From: Marc Zyngier To: Catalin Marinas Cc: yangwendong , 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 In-Reply-To: <20210412124637.GE2060@arm.com> References: <26f50e86-dc68-0aca-f29f-19ef2f884c5d@huawei.com> <20210412124637.GE2060@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: catalin.marinas@arm.com, yangwendong@huawei.com, will@kernel.org, mark.rutland@arm.com, Martin.Weidmann@arm.com, linux-arm-kernel@lists.infradead.org, wanghaibin.wang@huawei.com, yuzenghui@huawei.com, wangjingyi11@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210412_060914_085287_9BC1DCD7 X-CRM114-Status: GOOD ( 30.36 ) 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, 12 Apr 2021 13:46:37 +0100, Catalin Marinas wrote: > > 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. Note that since c219bc4e9205K ("arm64: Trap WFI executed in userspace"), we actively prevent WFI from being used in userspace, and I would expect WFIT to be given the same treatment. It otherwise is a precise tool for userspace to synchronise against kernel events. Thanks, N, -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel