Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp505205pxa; Wed, 19 Aug 2020 07:26:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSJEtncDMBIelrINwTarluF1EJI0tfyiCidkma6JitmBnwDNlGcEpb3FlNz0Nb1TnfeLIm X-Received: by 2002:a17:906:925a:: with SMTP id c26mr24513685ejx.121.1597847208910; Wed, 19 Aug 2020 07:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597847208; cv=none; d=google.com; s=arc-20160816; b=sfPB1A9CIhRcG7qw5fyF/54JEE2Dui2FAetqms8lJQU+o302+G5a2V4tK1nXx8qWl2 5Rgw+PXKDRjRBuzStvDzCGI03G+rmuGVtVaCxdnh8ZuMNBSPUydTaqYLBwuaXHoh0L9m EixdsL1hVOJ/mFYO5uwq+udieLLwZyyfBLtAN/nj1rmpBTOfaMFYZwHMF89+WgucfEWn uRP1vPBbHX2l8zWsTO3n78Au9M2y8/xSH++BFxYTUa6cFuvwslDFy5w1sGXZoilql5I1 8tgy0wZh2TAB1l2E+8yXcK1OigNCdsYg/m0Rx9zPcV2aOXjFnoVDEBAKzpwIxQ4kfk0X aDsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6jkd2KQnDmb11AhWH/o7SaB0T5YK6OXJV+5xJo0MfG4=; b=nib4lSio0Mi8zI7PMYCBLo+xeuSBLTOvTvUhKbl0j2GuAunxqU7z9NakjfImqLrOyr 3JPOdJAaloXDKCqS6qazGWRrDzJZEa6Z8vZ/N1GojPyTHCbg7vlYAnQnb03qb28we7Zk loGIQvW4lY8UgJW0qjr3Y8v/ykrQKy10hITPMiZ419KzRMFqov+jninqGeUp0Tv+N6YR 0CKGZZxGyXSgN6CWIH8byrlpcNxJ+GDggxj2WcXqkFJwdHwgutFrg782+mDwyuKoDXpR 78B+5mjspYDrGl7LYhGBundPFu4Ih4xcXtGmKlWw4TFjjr2AaHueuFujU/H/eSxIKHbs kUHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Lt+K5Zju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg13si15821958ejb.681.2020.08.19.07.26.24; Wed, 19 Aug 2020 07:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=Lt+K5Zju; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728498AbgHSOXp (ORCPT + 99 others); Wed, 19 Aug 2020 10:23:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728175AbgHSOXp (ORCPT ); Wed, 19 Aug 2020 10:23:45 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8273BC061757 for ; Wed, 19 Aug 2020 07:23:44 -0700 (PDT) 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, maz@kernel.org, will@kernel.org, catalin.marinas@arm.com, swboyd@chromium.org, sumit.garg@linaro.org, Julien Thierry , Julien Thierry , Will Deacon , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200819133419.526889-5-alexandru.elisei@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.