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.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 5F498C433B4 for ; Fri, 21 May 2021 09:13:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41E62613BB for ; Fri, 21 May 2021 09:13:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235731AbhEUJO0 (ORCPT ); Fri, 21 May 2021 05:14:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:52852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232804AbhEUJOV (ORCPT ); Fri, 21 May 2021 05:14:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DFAE613C4; Fri, 21 May 2021 09:12:57 +0000 (UTC) Date: Fri, 21 May 2021 10:12:54 +0100 From: Catalin Marinas To: psodagud@codeaurora.org Cc: will@kernel.org, Dave.Martin@arm.com, amit.kachhap@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown Subject: Re: sve_user_discard Message-ID: <20210521091254.GA6675@arm.com> References: <785d7bc29da6bff0dceeb712c24601fd@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <785d7bc29da6bff0dceeb712c24601fd@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 04:02:03PM -0700, psodagud@codeaurora.org wrote: > This is regarding sve_user_disable(CPACR_EL1_ZEN_EL0EN) on every system > call. If a userspace task is using SVE instructions and making sys calls in > between, it would impact the performance of the thread. On every SVE > instructions after SVC/system call, it would trap to EL1. > > I think by setting CPACR_EL1_ZEN_EL0EN flag, the processor faults when it > runs an SVE instruction. This approach may be taken as part of FPSIMD > registers switching optimizations. Can below portion of the code use > thread.fpsimd_cpu and fpsimd_last_state variables to avoid clearing > CPACR_EL1_ZEN_EL0EN for this kind of use cases? There were attempts over the past couple of years to optimise the syscall return use-case. I think the latest is this one: https://lore.kernel.org/r/20201106193553.22946-2-broonie@kernel.org I'll let Mark comment on his plans for reviving the series. Do you happen to have some realistic workload that would be improved by this? We can always write a micro-benchmark but I wonder how much this matters in the real world. -- Catalin 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.6 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,URIBL_BLOCKED,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 93F22C433B4 for ; Fri, 21 May 2021 09:14:58 +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 575E6613B6 for ; Fri, 21 May 2021 09:14:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 575E6613B6 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=XqNFbquVpF0EAFjrlHeilYPOFSn9CpPZSbJwP+0kAg4=; b=Ek+V+2JAdPdDb/dcEQ8tNb6KV1 9/S8MIp/t/xO0H4yhYoumy9RpOtntu2uTBiohdLv4Dc1jsBJOdwcK3auKPaQ80Qpq29XaI1Fw+S67 hbnDh1EBmioYWOHOQD44YPgFOK2owwrsRSgI0KrvisQbqz97rvpOKpkx7t8IMm6H7G0SZJH8MMBXv iF4naMcC2BH6muMFiG07mdMgi0bDLcopnwxHLAVWIy7eFo0cB5kkxDGOyLhtcQNSMr+Z/XZE58VZX CvYnODUk7nwywtNHXFUVQKofHYc61j5ULayRmqscPpI4SHaVyqqDVJebYpcivZbrtDCtYHLl9+S9t HxmdOJLg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk1DM-004e72-MH; Fri, 21 May 2021 09:13:05 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk1DJ-004e6P-PY for linux-arm-kernel@desiato.infradead.org; Fri, 21 May 2021 09:13:02 +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=ba8IcyoHREZvIWXRNX+mJemxDCgh+TgK8dLRhAoEehs=; b=HIMJ/mjduj81wjqz8M7g+8PbKG ns5Mv0/rExzJaXeZWDt2zScEvSMN1ZOhIrZkjnpK5I1GkgdS5pe3yhek5u/IJqRU6cBaLTwSI011p NsP7Hw/8DfCU4cMzibanuWnfaZJ6X883Se4nGeRbBAjy8grIP9sAWjmc/lhpeXZ6U8uFrC0fyHqfv 7Uyy53lT9o4z22xvJ1bsfuplCaMi7bcPqWeH0Ehispw6IP12W3KfL1eYFi6fBnfm/Xd/PQU1gIVMK 675rN9m2hkjXvOjh0j5hfB0ZFC0QOgy8uaUIEAEj8ZYLOEyb2Iz86CoklMFO1cWltzrfKKCNUKW6P T7Vni6QQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk1DH-00Gyko-1c for linux-arm-kernel@lists.infradead.org; Fri, 21 May 2021 09:13:00 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4DFAE613C4; Fri, 21 May 2021 09:12:57 +0000 (UTC) Date: Fri, 21 May 2021 10:12:54 +0100 From: Catalin Marinas To: psodagud@codeaurora.org Cc: will@kernel.org, Dave.Martin@arm.com, amit.kachhap@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown Subject: Re: sve_user_discard Message-ID: <20210521091254.GA6675@arm.com> References: <785d7bc29da6bff0dceeb712c24601fd@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <785d7bc29da6bff0dceeb712c24601fd@codeaurora.org> 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-20210521_021259_125426_4F08C356 X-CRM114-Status: GOOD ( 13.11 ) 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 Thu, May 20, 2021 at 04:02:03PM -0700, psodagud@codeaurora.org wrote: > This is regarding sve_user_disable(CPACR_EL1_ZEN_EL0EN) on every system > call. If a userspace task is using SVE instructions and making sys calls in > between, it would impact the performance of the thread. On every SVE > instructions after SVC/system call, it would trap to EL1. > > I think by setting CPACR_EL1_ZEN_EL0EN flag, the processor faults when it > runs an SVE instruction. This approach may be taken as part of FPSIMD > registers switching optimizations. Can below portion of the code use > thread.fpsimd_cpu and fpsimd_last_state variables to avoid clearing > CPACR_EL1_ZEN_EL0EN for this kind of use cases? There were attempts over the past couple of years to optimise the syscall return use-case. I think the latest is this one: https://lore.kernel.org/r/20201106193553.22946-2-broonie@kernel.org I'll let Mark comment on his plans for reviving the series. Do you happen to have some realistic workload that would be improved by this? We can always write a micro-benchmark but I wonder how much this matters in the real world. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel