Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1082100pxx; Tue, 27 Oct 2020 07:53:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf69twX0ZHv2qypiGH/Mv/HkPRtLKgZaW70j4zU1yg88OfZdZ9DA13wfNQMcZFxqmAjAH0 X-Received: by 2002:a17:906:c095:: with SMTP id f21mr2954501ejz.108.1603810414034; Tue, 27 Oct 2020 07:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603810414; cv=none; d=google.com; s=arc-20160816; b=Mk6bVxq23lapgzoasC4q3CojzmBVpPdkUwPQi5niJh3qYl9eXuUE74VzUS9ROmZ7b/ ZHuN7Fb9uIRwD6T/ruGhv9NAVb4HDHSVRlMK5mGRyHyxqj8Us4GurUMj9nkcNZh/WqqP 8P5ft7dRgmOH8yHPa7Oa0NdeOo4FF5aOd2Q4gl3g4bNNAcqOvFe9eQ+eH3kXevS2i+Kt jutFOruI2F3Nk5stmbnEWDz+Jt6JOfnPU/OTcJNrseE8XJgYdB6SXi2CKQVVsW2/q1xM 0N/FbgnTBkLT5T2yoeBd5XuG6hsA4DN+68rKx3vL6Mluz/o6X2Z4gWnmfQn3/rsoKMWf sjYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EMbv013hxb/4gPOUK8hbOEdoU8C2dgtEhB0AjU3ttHw=; b=KGlACzred/D4kZDKm0kmNKPIOYJFPplnVFaS9D5B/WPM2LfbheTjfJDekbbT49gOLV Gq9C4pLnY1agwOw/BrFcOxVfYakQqlkH3e2EI8xLZX6uizo88oO9f02brRIw+9935U08 xVfb0uvBAR1egnNRkgR8C9XSna+GctPvbx1nY5EpBu8Drrfe1z4dd7LaMMZJU4ruu1Jo E70+T+FNulCEQ38zgmBIgp4qP4bj28NFfd8gpHwUcw9rZHl9PA8T99Gz3Po4rzK9fraD jfFPC3PtWz5GcOQ1wYbBmz+jSwSr/Wr/0aXapuoisDvu1nr7T7NgrxIfRb7DuR8TaCtd x5OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gF4XWhuw; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si1045953edy.362.2020.10.27.07.53.11; Tue, 27 Oct 2020 07:53:34 -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=@linaro.org header.s=google header.b=gF4XWhuw; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751826AbgJ0NRZ (ORCPT + 99 others); Tue, 27 Oct 2020 09:17:25 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:43821 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440805AbgJ0NRZ (ORCPT ); Tue, 27 Oct 2020 09:17:25 -0400 Received: by mail-lf1-f66.google.com with SMTP id l28so2236614lfp.10 for ; Tue, 27 Oct 2020 06:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EMbv013hxb/4gPOUK8hbOEdoU8C2dgtEhB0AjU3ttHw=; b=gF4XWhuwKAoT+jOkMwMRRmdiuFKvMmsahf8xpHF1u+MNcvDBKAJeh91xSP7SU+tV+N zd0Dx7yJjL6ua/9m8rHrI37ObGjikYyLQMzBoIIY8Y7e2n+sCj2IKYpHahWUaNa1icoV Ndj/+L+NUDrwuBgJmyeMyat31xHWM5oFT+kN+KJBQxbCZK+PH93MrUxcJg7i/t3nc5/y cyAsgQVdgD75idmwmFPnCCuhABF9SaPCaa7Bx3JY4XXYBEF946brtQVxAUmsBwuMnxmL m5wVj6rxX9Jb2z2b/uuVUfYSzwDNqcS27NR4CxFg1Q8K1nGW3tFuRC3pcFKNk8XU4QOZ 1iOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EMbv013hxb/4gPOUK8hbOEdoU8C2dgtEhB0AjU3ttHw=; b=H7AYpHFmPKYuOjN35IYBghZu1GNdrHlMDwDMp/YQxE/qLzvajjOp0Ow+/sJFeEHnaq HXVESuln57/ZLc7/x9Y4Ix2YjPZqNz4SPaxnR6YtHwMn3rlKQL+g0I4zylSFlxT6dNS3 yudvusY5z5Bxs6kAMNlgVF+es0Na/Al7UMjnDG71jUC9j5/Wmv6fH+3Qdt25t3bq7M6j xvOD1YHFMEKo5KE2oHtP0uFrH5/wIzUV86bC4jct8GHn7aSlBJ/Ht2bXhnLEnJmHBdKO iTHL18rKVneItdo5Q+1oRgHxhdrWFq5F/lQRkbnast/i25yJc9F5FV5XjQQbmqbr3Kv1 lqug== X-Gm-Message-State: AOAM5303CgGKsKRpxhFjoH3js9X/NNuWT4Rn9Jy3+yLLXL8KRhmNgr5T 6xGVxqO6l4Xvg34llns0992wdvQGJgKzk5HqEVrrzQ== X-Received: by 2002:ac2:5a4f:: with SMTP id r15mr988614lfn.258.1603804642325; Tue, 27 Oct 2020 06:17:22 -0700 (PDT) MIME-Version: 1.0 References: <20200901144324.1071694-1-maz@kernel.org> <20200901144324.1071694-4-maz@kernel.org> <353f13b0dcc6c7ea1b44012d9632a0cc@kernel.org> <7b754dfe579044902d3468b9f864bd37@kernel.org> <11951c39bc676b83def46150e58e8df3@kernel.org> In-Reply-To: <11951c39bc676b83def46150e58e8df3@kernel.org> From: Vincent Guittot Date: Tue, 27 Oct 2020 14:17:10 +0100 Message-ID: Subject: Re: [PATCH v3 03/16] arm64: Allow IPIs to be handled as normal interrupts To: Marc Zyngier 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Oct 2020 at 13:06, Marc Zyngier wrote: > > 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... At least, we know the root cause and the impact of irq_enter/exit > > M. > -- > Jazz is not dead. It just smells funny...