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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 1C5C7C433B4 for ; Mon, 10 May 2021 16:19:19 +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 9C5DE61132 for ; Mon, 10 May 2021 16:19:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C5DE61132 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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MPXwDxIw0Zc+L2QmV5rqtwD2/f/eztB0e8gjDUZ1wVs=; b=OEH7gByfgYgDXwP/OWXBfAOCg 1ERaDyIvQiuPGL6xcMhdEOGkuce6JACNo6gtt71C7PK9x29uFIckHVBaFXGUC2+zGUu72vQRYORwg qgXYlefyh7WH0H9L6xpi/0UEBm2RHXM+OVPSzxzLRkUFj/qtO08L1DeAMLQFTXnkpijKxEeVDv3nP JF6rjj7SSFbScmL8v3lRsatRSjMvwdxovgOMfFV7xdsRG54BxpieezatTuLLyabQ9wTDIf9SVk01R 2OozJ4wLoBHS2Xa928gSA1vuRBoFPvkZIKtA+pcwWTTgSwi98/tDw9sYtCYVUYSbpT9oiqUYMMjkA 2paS/GqHw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg8bI-00EvgE-8N; Mon, 10 May 2021 16:17:44 +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 1lg8bE-00Evet-KL for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 16:17:40 +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=GaO79FrLrraC8oQSqr6GJtayE4T3uxJSakEFSw9RigQ=; b=0IYCQE3ha4vxfM8gBlsDRMyjtI x4u6WO4Btd119oTaTGjsmbvMgYjsvth4UP1O2wmIbx5GRyV/JZyL57GgoubV0AoYgXw2fHQTsqs64 LbGBItzdTAu0BeDNwpYStpIstbeYDDPZ9V9h8Gh9bTyZK+lHmY1Mqe5Utbyrs9LI5Fc+nreYhxByc pEkBKWxmhWN6yvIWIhUMS+fc/U9r0PPeW8O6VBZmKptJYDNfj8v/Ph0veuZ1j3Lk1xt3oZHqoTJHJ MwxG5L02R853d5fretk4bTvB1LYkOAVSWkpVxJ+wSAJ9cX462FUIZs6N6ovwue1tX5cM7gul1XxeN QSBcWWiw==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg8bB-008uab-W4 for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 16:17:39 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3F07A61132; Mon, 10 May 2021 16:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620663457; bh=eaE4FtvdyNWTR53HoKMQ+Fl3S7B5/KwIbpvHnuwDChs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=F2ZU+Bzc/flueGnYyigql5ahuvzIgyvE9X1sC/3O4+luIyVWiJgF7mprmSCk+QMME GR+urSshhx5q/+8tUANnFCRU1qZ8Djs2lcYdieMIdpmBs8eCUh5e5j8vuWjcEu9gsA XWLxHsW1oIv/+oWFvQxBvpfXHi1sFjXb96/9XDjCOiwjCk3jjiofGkQgr2PvFcZxjq Tb3Ywj26vKpSMyuC/wj73+q3HLlVgshrEiY5kfD4i0ZSkLQIOjqj6rqqpiYg3Q6Q2q eNi5DWSVqBeKafKJxYKvBYggpWv0JNyKqP+Ro/9K04gRAfO667xPs9m7Hgdu7nLAl8 R3kYxLHpuFYnA== Date: Mon, 10 May 2021 17:16:58 +0100 From: Mark Brown To: Dave P Martin Cc: Catalin Marinas , Will Deacon , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v1 3/3] arm64/sve: Skip flushing Z registers with 128 bit vectors Message-ID: <20210510161658.GC4496@sirena.org.uk> References: <20210510122348.56443-1-broonie@kernel.org> <20210510122348.56443-4-broonie@kernel.org> <20210510150809.GC18631@e103592.cambridge.arm.com> MIME-Version: 1.0 In-Reply-To: <20210510150809.GC18631@e103592.cambridge.arm.com> X-Cookie: Beam me up, Scotty! 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-20210510_091738_103172_E0E2A2F1 X-CRM114-Status: GOOD ( 21.86 ) 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: multipart/mixed; boundary="===============4865688890350991430==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4865688890350991430== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ALfTUftag+2gvp1h" Content-Disposition: inline --ALfTUftag+2gvp1h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 10, 2021 at 04:08:09PM +0100, Dave P Martin wrote: > On Mon, May 10, 2021 at 01:23:48PM +0100, Mark Brown wrote: > > SYM_FUNC_START(sve_flush_live) > > + cbz x0, 1f // A VQ-1 of 0 is 128 bits so no extra Z state > Should we worry about branch mispredicts here? It may be in the noise, > but I wonder whether it's worth considering use of alternatives here > instead. If people are happy adding an alternative we can definitely do that, people seemed to want to avoid them in the past and at this point I don't have concrete data to support how much of a win is but it seems very likely that it'll have the best overall performance - systems that only have 128 bit vectors will never have to worry about the non-shared bits and... > I have a suspicion that VL =3D 128 bits won't be common at runtime, except > in the case of systems where the physical (or max usable) vector length > (i.e., sve_max_vl) is 128 bits. =20 =2E..like you I expect that systems with more than 128 bits won't tend to configure down to 128 bits. At the minute it's kind of finger in the air what the practical impact actually is though, quite a lot of unresolved variables. Given the recently announced requirement for SVE in v9 I'd expect that we'll actually see quite a lot of 128 bit systems in the wild for at least some period, like with our own Neoverse N2 cores. > > + unsigned long vq_minus_one =3D > > + sve_vq_from_vl(current->thread.sve_vl) - 1; > > + sve_set_vq(vq_minus_one); > > + sve_flush_live(vq_minus_one); > Seems reasonable. sve_flush_live() could alternatively be made a C > function, with asm wrappers for sve_flush_{z,p,ffr} so that the > conditional logic can be inlined -- but I can't see that it would > improve the generated code much. So I'd be happy with it to stay in > this form. Yeah, I faffed a bit with options but it seemed like the effort wasn't going to be worth it, mainly inflating the size of the code change. --ALfTUftag+2gvp1h Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmCZXHkACgkQJNaLcl1U h9Dquwf+Mirm/Kvat4JBuTBErjxXZQLcz+A45OVfEnJnNpLWXGHJoovJ3ouQvW1n SanKFJbxBpfor1nNkRMz81HkHtsW4ckp4PfBOgEL3K/QNFdmpniJPgiZnt/N297w BjOCTeJuhXA9ebA9ePCCCzaOkDjH/v0y279T9mPraQu+13oMXlFkb4F6pioVSw3R jTFaZk3P8qREMPiCNukS7kGbI/YTZwL+NwC9KBr7rgRvqNpYIQMxpMBxgNcapMNI j2kDQPaCEVgrD4zByHDD6g1kdwA9VYlMIg+e6TGzWjuIx/j4bA8pKzOj1ZLz9QQL 9KetGKuUAT4gL7zFH0L/O0RakajR9w== =rsIg -----END PGP SIGNATURE----- --ALfTUftag+2gvp1h-- --===============4865688890350991430== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4865688890350991430==--