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=-3.8 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 845D3C433E1 for ; Wed, 19 Aug 2020 14:25:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 51B892076E for ; Wed, 19 Aug 2020 14:25:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="U9msnhrE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Lt+K5Zju" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51B892076E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=lr2HrC7RAQLL0NmmGwj2TwjWgF055aFQhlnrsgcdHeM=; b=U9msnhrEYo2EiCUsAuJlZroMr 68FER1Ac3BzJ8UdHwi/dr1fpGI2l+/1F87C739Ze1QGrZ0/pEULi317V3hqW3SDlWmjrTXxQ5Zd1Y ySwaMaRD8g/sHnfO0/MkRwKTeNE/M/pYPozAbZsUKpv0ePakNyYIMWnvo9OkVQ4jRprr6piTdZnKk UTPlrPhpCGUxhK6sKkdB2Bfgk78lWxo4iV2fMQD1xujwaBaVl6tKn30qO38qK7hqUXrU9XgMiJKaC TIpiZyJCPXI9loXwLQE7my7tnNldvYZdE8z2ftOgGNH1NLk/+XN0t2AV0l626kG5vR/iaS+ZqG5pD Rju1QailQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8P02-0004wr-It; Wed, 19 Aug 2020 14:23:34 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8P01-0004wd-Ae for linux-arm-kernel@merlin.infradead.org; Wed, 19 Aug 2020 14:23:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=6jkd2KQnDmb11AhWH/o7SaB0T5YK6OXJV+5xJo0MfG4=; b=Lt+K5Zju1LJvBjwSVTyQwxo91l 7kGb1KiLSv7PPXrRkCsZiijnLIxSpJOCJcXlU6oqe2v5IrYACvSq2kz6ICtryMrr5CGyTV+n5eAsJ pfpYWVzTpg4fRG9SG2CkglhcyZgroe2YRWDBxBvd9em/QBq4/BR4KTilLd62NLYj4quR5pvGeGaRE yWh2r5QhzZJqHhSoUWZSBpTHbPTsCQlMXZnTwL1g+sDa15t1cYszmahFB78te08nVZH7cBK4wDMF6 ilEpLrNfJDxCFz5BmeQYXWZjk7J3z4pYXvlCGD7gw6Op9LKYitbIeT3f1+MV8DYb5ixkzO6fAXwew eso1Iuaw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8Ozv-0005en-Aj; Wed, 19 Aug 2020 14:23:29 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 2F26D3059C6; Wed, 19 Aug 2020 16:23:26 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0AF8C20D805B3; Wed, 19 Aug 2020 16:23:26 +0200 (CEST) Date: Wed, 19 Aug 2020 16:23:26 +0200 From: peterz@infradead.org To: Alexandru Elisei Subject: Re: [PATCH v6 4/7] arm64: perf: Defer irq_work to IPI_IRQ_WORK Message-ID: <20200819142326.GE2674@hirez.programming.kicks-ass.net> References: <20200819133419.526889-1-alexandru.elisei@arm.com> <20200819133419.526889-5-alexandru.elisei@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200819133419.526889-5-alexandru.elisei@arm.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, sumit.garg@linaro.org, Julien Thierry , Alexander Shishkin , maz@kernel.org, Jiri Olsa , Will Deacon , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , swboyd@chromium.org, Ingo Molnar , Julien Thierry , catalin.marinas@arm.com, Namhyung Kim , will@kernel.org, linux-arm-kernel@lists.infradead.org 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 Wed, Aug 19, 2020 at 02:34:16PM +0100, Alexandru Elisei wrote: > From: Julien Thierry > > When handling events, armv8pmu_handle_irq() calls perf_event_overflow(), > and subsequently calls irq_work_run() to handle any work queued by > perf_event_overflow(). As perf_event_overflow() raises IPI_IRQ_WORK when > queuing the work, this isn't strictly necessary and the work could be > handled as part of the IPI_IRQ_WORK handler. > > In the common case the IPI handler will run immediately after the PMU IRQ > handler, and where the PE is heavily loaded with interrupts other handlers > may run first, widening the window where some counters are disabled. > > In practice this window is unlikely to be a significant issue, and removing > the call to irq_work_run() would make the PMU IRQ handler NMI safe in > addition to making it simpler, so let's do that. Makes sense, IIRC this code was written before ARM grew IPI_IRQ_WORK support and then it makes sense, but now that you have it and are moving to NMI-like context this is absolutely the right thing to do. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel