Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp140151pxx; Wed, 28 Oct 2020 00:22:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2YT1uJOUIOc6wlVAhIIiI3tZXTWBcuXe1LXwrjudY/kiW2ToMSGGDNoWZHoHIbI++XOpq X-Received: by 2002:a50:eb45:: with SMTP id z5mr6201729edp.144.1603869724130; Wed, 28 Oct 2020 00:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603869724; cv=none; d=google.com; s=arc-20160816; b=mudh4MzsPP03MPAF5aa2SyTMF0BtazpXk7F0Ms2VeiUzYj4+rn8oHq84YSwpjdQ4/2 qS3BvVGOqezNiRcSOvN+Pfah8LfvCIUQousEL9gfK19vuJigp4vYrHRJWfF+7uyGpwk0 d/BVVuo/FsJeIIf0DaZ2bNgb4wamxlR8bkIv4h76JGqo/xQ2COet0vMvVymGxdAc6fAa EsnCP9c8+9nsoDB+FcVhEcmua7UQBY0KiHAC3y51AXHmiyGb9+G/nHEvIaCZ8foU8zqG O0OyPFsm8GlVUlxP8llSzUPj1xTEnGFS1eNOoSz/N4fCzUeOq7w9Wd6jA0uueVIcxMq2 kLJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=9CZcdMPEJwUgqCbOfUIWtPVLoqgZCBzFAP1YkrsKEWU=; b=bnz8XyBrqtt1rKc1qIFdZAcv//GToL0mMbU9Z/sS7+rq1avFK5CHajtmIpBeJLALqh 0Bp//YiRuO3FcAIYTReSd26MDqBngDmatQx9al/eJAko0i7WQyGoBjcQOhaeqjC4/2u3 NZHYG5Bv9h037Rt/dB36whJEHdkE2k2oJ0m1xK+WGZPeP2lUoa42dgpf03Ctflz3uCXX uPmeBaBBzM6UN91NsaU2dIC1pZSnDHKaCR+xjafbtQdIal2QhVKtMIf+ahjjnjurdS0F flMjkPsZKsfDMnv6qgphkM3WQLD4Be+Y8UFWB567eBh4vKnQSs6d7MoEAizVD+GDTZ9I 1rjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wVU81IBg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ba15si2744869edb.347.2020.10.28.00.21.41; Wed, 28 Oct 2020 00:22:04 -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=pass header.i=@kernel.org header.s=default header.b=wVU81IBg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750640AbgJ0MGJ (ORCPT + 99 others); Tue, 27 Oct 2020 08:06:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:54744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750636AbgJ0MGJ (ORCPT ); Tue, 27 Oct 2020 08:06:09 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D87B722264; Tue, 27 Oct 2020 12:06:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603800368; bh=h2JSf7zkOuIxpb10PQ5i/18/ehXzNDpVaiT54yUduwI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=wVU81IBgZfupXY+Ww7y1M1QdtUt6r1EVBjgUBfu7Cc7L1vm4zF90OF2wed95UwvR3 alBV+89qS4Rfd+PDw4lQA8sH7SmXhQhBRz8o53Zo9D3Mo9f13rsCV07dR8LD3FYMp9 lzd0NED30lx/8XtRJDVNMYzrMG8VBVErLYldZvgE= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kXNjp-004g8O-Ky; Tue, 27 Oct 2020 12:06:05 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 27 Oct 2020 12:06:05 +0000 From: Marc Zyngier To: Vincent Guittot Cc: LAK , linux-kernel , Will Deacon , Catalin Marinas , Russell King , Thomas Gleixner , Jason Cooper , Sumit Garg , Valentin Schneider , Florian Fainelli , Gregory Clement , Andrew Lunn , Saravana Kannan , Android Kernel Team Subject: Re: [PATCH v3 03/16] arm64: Allow IPIs to be handled as normal interrupts In-Reply-To: References: <20200901144324.1071694-1-maz@kernel.org> <20200901144324.1071694-4-maz@kernel.org> <353f13b0dcc6c7ea1b44012d9632a0cc@kernel.org> <7b754dfe579044902d3468b9f864bd37@kernel.org> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <11951c39bc676b83def46150e58e8df3@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: vincent.guittot@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, linux@arm.linux.org.uk, tglx@linutronix.de, jason@lakedaemon.net, sumit.garg@linaro.org, Valentin.Schneider@arm.com, f.fainelli@gmail.com, gregory.clement@bootlin.com, andrew@lunn.ch, saravanak@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-10-27 11:21, Vincent Guittot wrote: > On Tue, 27 Oct 2020 at 11:50, Vincent Guittot > wrote: >> >> On Tue, 27 Oct 2020 at 11:37, Marc Zyngier wrote: >> > >> > On 2020-10-27 10:12, Vincent Guittot wrote: >> > > HI Marc, >> > > >> > > On Mon, 19 Oct 2020 at 17:43, Vincent Guittot >> > > wrote: >> > >> >> > >> On Mon, 19 Oct 2020 at 15:04, Marc Zyngier wrote: >> > >> > >> > > >> > > ... >> > > >> > >> > >> >> > >> > >> One of the major difference is that we end up, in some cases >> > >> > >> (such as when performing IRQ time accounting on the scheduler >> > >> > >> IPI), end up with nested irq_enter()/irq_exit() pairs. >> > >> > >> Other than the (relatively small) overhead, there should be >> > >> > >> no consequences to it (these pairs are designed to nest >> > >> > >> correctly, and the accounting shouldn't be off). >> > >> > > >> > >> > > While rebasing on mainline, I have faced a performance regression for >> > >> > > the benchmark: >> > >> > > perf bench sched pipe >> > >> > > on my arm64 dual quad core (hikey) and my 2 nodes x 112 CPUS (thx2) >> > >> > > >> > >> > > The regression comes from: >> > >> > > commit: d3afc7f12987 ("arm64: Allow IPIs to be handled as normal >> > >> > > interrupts") >> > >> > >> > >> > That's interesting, as this patch doesn't really change anything (most >> > >> > of the potential overhead comes in later). The only potential overhead >> > >> > I can see is that the scheduler_ipi() call is now wrapped around >> > >> > irq_enter()/irq_exit(). >> > >> > >> > >> > > >> > >> > > v5.9 + this patch >> > >> > > hikey : 48818(+/- 0.31) 37503(+/- 0.15%) -23.2% >> > >> > > thx2 : 132410(+/- 1.72) 122646(+/- 1.92%) -7.4% >> > >> > > >> > >> > > By + this patch, I mean merging branch from this patch. Whereas >> > >> > > merging the previous: >> > >> > > commit: 83cfac95c018 ("genirq: Allow interrupts to be excluded from >> > >> > > /proc/interrupts") >> > >> > > It doesn't show any regression >> > >> > >> > >> > Since you are running perf, can you spot where the overhead occurs? >> > > >> > > Any idea about the root cause of the regression ? >> > > I have faced it on more arm64 platforms in the meantime >> > >> > two possible causes: >> > >> > (1) irq_enter/exit on the rescheduling IPI means we reschedule much more >> > often >> > (2) irq_domain lookups add some overhead. >> > >> > For (1), I have this series[1] which is ugly as sin and needs much more >> > testing. >> >> Ok, I'm going to test this series to see if it fixes the perf >> regression > > You have spotted the root cause of the regression. We are back to ~1% > performance diff on the hikey Yeah. Only thing is that I can't look at this hack without vomiting... M. -- Jazz is not dead. It just smells funny...