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.4 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 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 A3976C433B4 for ; Thu, 6 May 2021 09:20:05 +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 3534A610A2 for ; Thu, 6 May 2021 09:20:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3534A610A2 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=HP6TrinGkmb93WyoearGzhxeSYAnCykwL8XKcLFNL6U=; b=Issv90EhjqqD2Yuhd+DyhOD1Z TX5hqP1HgttmBcSTngl1Sz+L8h0Fp8UbEF4veWGe6o0Vm3Szyen5mp88ZLSZAUZez14SQZuAQy4dK qWy25sBkYEvB112w5eRe8toe6fmys/nRyjHLP1DXw+DZ0L6uy0lx/3zKnM5kMi305vFE2k5jdG+U2 BN+rIIu2f8ERODtxy/Z6LjJWDYalP4DjSoRyz7fz5C40kEwkQ8DV1XXBWgbgZZzhUIesbO2OlZY4D uyYqmVkmoLzcfKUNv5aq2OXuHHdc3j1xe5DUwaoHTBpiyztjdwoDWWM7W34VUXsKnW2b5Ne6juvNa QHIqYiD9Q==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea7p-003mWO-VA; Thu, 06 May 2021 09:16:54 +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 1lea7i-003mUp-ON for linux-arm-kernel@desiato.infradead.org; Thu, 06 May 2021 09:16:46 +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=CERiW2EtqgiSN8WlWYwtBr3Zp3f4drN1deYQ0+ir5DQ=; b=ae92f0OExWKvfl57pA9lF2Xrew Bab5c20ZxwJ25w9o7Nfsfd+vHOwPe63bUufjTtjfQHccY7Cq90SzKis4YfRW3h6embM03SUPGmLcl R6kdR9izviZxk3NhqqAPePbnRUWRDrZlIvkWsD5y2p6TSWRQSvuUSN0I9QPQnnEylWlARbnoNgmAl 6k6ugCXDvbDlY0sMjULSVhyM1ei9NSpDJoqim23fyKhqxn3swEHVOJTFlw2uK5y7qCmto/4KCADUz N4dk7tvGQg3SX3IFVdmQLJXdi7cgKU7WZ1i9yXbaASZznig5M0P3QGSQPgmVtwyniu+FhLonSn9HC RHbOyxyQ==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lea7g-005tuC-3F for linux-arm-kernel@lists.infradead.org; Thu, 06 May 2021 09:16:45 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F88FD6E; Thu, 6 May 2021 02:16:42 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.31.158]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4511A3F73B; Thu, 6 May 2021 02:16:40 -0700 (PDT) Date: Thu, 6 May 2021 10:16:37 +0100 From: Mark Rutland To: He Ying Cc: catalin.marinas@arm.com, dvyukov@google.com, elver@google.com, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, paulmck@kernel.org, peterz@infradead.org, will@kernel.org Subject: Re: [PATCHv2 06/11] arm64: entry: move el1 irq/nmi logic to C Message-ID: <20210506091637.GC12883@C02TD0UTHF1T.local> References: <20201130115950.22492-7-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_021644_204624_9329CBE1 X-CRM114-Status: GOOD ( 11.87 ) 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 06, 2021 at 04:28:09PM +0800, He Ying wrote: > Hi Mark, Hi, > I have faced a performance regression for handling IPIs since this commit. > > I caculate the cycles from the entry of el1_irq to the entry of > gic_handle_irq. > > From my test, this commit may overhead an average of 200 cycles. Do you > > have any ideas about this? Looking forward to your reply. On that path, the only meaningfull difference is the call to enter_el1_irq_or_nmi(), since that's now unconditional, and it's an extra layer in the callchain. When either CONFIG_ARM64_PSEUDO_NMI or CONFIG_TRACE_IRQFLAGS are selected, enter_el1_irq_or_nmi() is a wrapper for functions we'd already call, and I'd expectthe cost of the callees to dominate. When neither CONFIG_ARM64_PSEUDO_NMI nor CONFIG_TRACE_IRQFLAGS are selected, this should add a trivial function that immediately returns, and so 200 cycles seems excessive. Building that commit with defconfig, I see that GCC 10.1.0 generates: | ffff800010dfc864 : | ffff800010dfc864: d503233f paciasp | ffff800010dfc868: d50323bf autiasp | ffff800010dfc86c: d65f03c0 ret ... so perhaps the PACIASP and AUTIASP have an impact? I have a few questions: * Which CPU do you see this on? * Does that CPU implement pointer authentication? * What kernel config are you using? e.g. is this seen with defconfig? * What's the total cycle count from el1_irq to gic_handle_irq? * Does this measurably impact a real workload? Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel