Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp807753pxa; Wed, 5 Aug 2020 13:16:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMdonU60p7zXmHuAvQdGnbu+xR4qqUg84HkpY6x5srU/cc7f5R4CWDxvyONH18g02lw5hv X-Received: by 2002:a17:906:4f8f:: with SMTP id o15mr1035640eju.220.1596658602030; Wed, 05 Aug 2020 13:16:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596658602; cv=none; d=google.com; s=arc-20160816; b=OeIDVxv84hSdVxzYyxBusacquw7Q9FPyV7NJdvK5hwe/qzV4zplOHN9ymqSWhEhPj+ +kLrvxYa/L6CQKvODNL7dqlJixnLPxi4EYvtD2rF7naLVYuFzFO+QHCAX/rWppTXQ9KM UNTwQbgMU9rB8OAYBowoX9AGwkpPEyWI4RkmQDDlX9nFtwZJ1/OO8J8qNyahTlBe6lM2 XV6SRiGquHnk8RGziCWhzMbDW8kJZHZt4eBQyYmlu6SIrB3avGC4OusZK4sHf61vCFyR c3RdQChOd+adpXBnEZFRlgiuDMyMhzsXr++ITetUbpJRrnEnpLHRDNa351nXFbNDG81z c2EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=uRgpxCLYTmF/Jtdvr7uQayUeHRhkYJIJZBEu0F4sKJ4=; b=jvB2TjIu0tYsvml/wOJ9dp8QhHZbeefIEh6tn2bEW/a9gtKrODgYi1MQGFRmaSaiu/ jHAVmxDqEdpW9C0xtFP2mxU8KWMhLcHyYpFAIaPtA5DIiWoe/RqdbPPrb5dQt89NmdUw hUscPuVGXiYadBgw85aGekMTeDqU6yQG3vLZ8bDI5QyCq5nBW3dh/lLsmQ8XwzFa2wrz Xy3ntVPq4/KTQl1Br0IYRcLFVz5IonuSZsclOCPoFlS/L3S6IBrLpySoX5zUyAXcPImJ tPUei7mD9ADr1zTcmqbUpOxJaM8SE87bnhY1liSkPlLt2NyjRa2BkM0qPc2C4K2FioV6 5lpw== ARC-Authentication-Results: i=1; mx.google.com; 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 r5si1866402edx.458.2020.08.05.13.16.19; Wed, 05 Aug 2020 13:16:42 -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; 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 S1729598AbgHEUOK (ORCPT + 99 others); Wed, 5 Aug 2020 16:14:10 -0400 Received: from foss.arm.com ([217.140.110.172]:33034 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbgHEQX0 (ORCPT ); Wed, 5 Aug 2020 12:23:26 -0400 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 264F913D5; Wed, 5 Aug 2020 06:56:56 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B9B13F7BB; Wed, 5 Aug 2020 06:56:54 -0700 (PDT) References: <877dumbtoi.fsf@kurt> <20200729094943.lsmhsqlnl7rlnl6f@skbuf> <87mu3ho48v.fsf@kurt> <20200730082228.r24zgdeiofvwxijm@skbuf> <873654m9zi.fsf@kurt> <87lfiwm2bj.fsf@nanos.tec.linutronix.de> <20200803114112.mrcuupz4ir5uqlp6@skbuf> <87d047n4oh.fsf@nanos.tec.linutronix.de> <875z9zmt4i.fsf@nanos.tec.linutronix.de> <20200805134002.GQ2674@hirez.programming.kicks-ass.net> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: peterz@infradead.org Cc: Thomas Gleixner , Vladimir Oltean , Kurt Kanzenbach , Alison Wang , catalin.marinas@arm.com, will@kernel.org, paulmck@kernel.org, mw@semihalf.com, leoyang.li@nxp.com, vladimir.oltean@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Anna-Maria Gleixner Subject: Re: [RFC PATCH] arm64: defconfig: Disable fine-grained task level IRQ time accounting In-reply-to: <20200805134002.GQ2674@hirez.programming.kicks-ass.net> Date: Wed, 05 Aug 2020 14:56:49 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/08/20 14:40, peterz@infradead.org wrote: > On Mon, Aug 03, 2020 at 09:22:53PM +0200, Thomas Gleixner wrote: > >> totaltime = irqtime + tasktime >> >> Ignoring irqtime and pretending that totaltime is what the scheduler >> can control and deal with is naive at best. > > Well no, that's what we call system overhead and is assumed to be > included in the 'error margin'. > > The way things are set up is that we say that, by default, RT tasks can > consume 95% of cputime and the remaining 5% is sufficient to keep the > system alive. > > Those 5% include all system overhead, IRQs, RCU, !RT workqueues etc.. > > Obviously IRQ_TIME accounting changes the balance a bit, but that's what > it is. We can't really do anything better. > I'm starting to think that as well. I tried some fugly hack of injecting avg_irq into sched_rt_runtime_exceeded() with something along the lines of: irq_time = (rq->avg_irq.util_avg * sched_rt_period(rt_rq)) >> SCHED_CAPACITY_SHIFT; It's pretty bad for a few reasons; one is that avg_irq already has its own period (PELT-based). Another is that it is, as Dietmar pointed out, CPU and freq invariant, so falls over on big.LITTLE. Making update_curr_rt() use rq_clock() rather than rq_clock_task() makes it "work" but goes against all the good reasons there were to introduce rq_clock_task() in the first place. > Apparently this SoC has significant IRQ time for some reason. Also, > relying on RT throttling for 'correct' behaviour is also wrong. What > needs to be done is find who is using all this RT time and why, that > isn't right. I've been tempted to say the test case is a bit bogus, but am not familiar enough with the RT throttling details to stand that ground. That said, from both looking at the execution and the stress-ng source code, it seems to unconditionally spawn 32 FIFO-50 tasks (there's even an option to make these FIFO-99!!!), which is quite a crowd on monoCPU systems.