Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1696065pxa; Thu, 6 Aug 2020 13:42:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTBhsfPO94CLpkdNRxRUSz+SYpDxdWFsiJqfPRDe6NUWc6tmXgq4PNPp0OOZ3qKDXz+oHE X-Received: by 2002:a05:6402:c84:: with SMTP id cm4mr5782203edb.20.1596746538675; Thu, 06 Aug 2020 13:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596746538; cv=none; d=google.com; s=arc-20160816; b=x29VzkwFGu9zXkkwVv7DjU8K3NZxFpj//0Hink6Hg9tIoHLySDt9+fODCK2wYdOd3F fo+6wfscKOQ0h9Fqhh+1TXiwGI1KGBNP44f24xUPtU9LJLlubjSSMOVKoV5ZU549xc5J 9MuW7Rhj7wovfMNg11otrgo/k2gJkUBlg0MXDSPwTXGTlBSJ1hiGvHHmSS7GPplMGX9J PkVW91QLrgMhHrOi104s0kLFX+ZfUF80P+/s83pwIOX0SN2+992KwNyxfMj/j8n/6SfL uJfqW7xPWnlL/O5aY3i57KeREINPurbaVj1PHp0gkoyj1rNd3zjdq9T3Iom8AJ1cy0iQ yQog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=KKXcgDQzf7Vjb5bvEvuCm4NgEEB+CaL9l1tP7JH9WNU=; b=e92fT8+LRM87FM5nsdcJT+LCwGGPXFW8ibtrJcS6jEIS92o5YTLGqrgcc/OOqIyL9+ tZ47VCeyRs4yC1mNGOrTmpxHnGCIp4ktICDZvVLOub35Wj1eETZD6f6EkBzaVVno9Dr4 C6qT2GVvp+T5UaLVs4t6eGjAPLpTAcPm6+qcw0DV6SFzgzi6Cp9nnZVGcWwEv4DuLoSV 9bcQLIIhVWWEJMaMvbaf2BbD1NJvwLIvZ5R6jRhSzeONoxfw6loDO/gyD3RKC05aT8H4 7wVKjjclcHz1zxUOlvL6QL8J6RQZo+xSTnppKWHVbotV2NfXcs23/mUjjGr/S7PBKmq2 6b3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LDZwk8Jo; 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 l8si3592095ejq.668.2020.08.06.13.41.55; Thu, 06 Aug 2020 13:42:18 -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=LDZwk8Jo; 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 S1726238AbgHFUjQ (ORCPT + 99 others); Thu, 6 Aug 2020 16:39:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:48374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725272AbgHFUjP (ORCPT ); Thu, 6 Aug 2020 16:39:15 -0400 Received: from paulmck-ThinkPad-P72.home (unknown [50.45.173.55]) (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 EB00A20855; Thu, 6 Aug 2020 20:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596746355; bh=q8V+QooAedDTCZwwSoD3LNTl7TcgV2NB4V/wTSRx1Pg=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=LDZwk8Jookz+8ELmpEdSs4hIHa/yqQi0yTAmATPUiu/FQwE9I9q7uc7L0m5bL1qOa htHvVr1Bk8XaKx/NbkCTIpAx20ycbLK6+vBMOV+kij4dUJOUjXMAjsiRXhiptghsnp mxzb9Pi0G4qkJ0rrLs168mHtyVl7FtLJozYPA2Oc= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id A95F23520734; Thu, 6 Aug 2020 13:39:14 -0700 (PDT) Date: Thu, 6 Aug 2020 13:39:14 -0700 From: "Paul E. McKenney" To: Thomas Gleixner Cc: peterz@infradead.org, Valentin Schneider , Vladimir Oltean , Kurt Kanzenbach , Alison Wang , catalin.marinas@arm.com, will@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 Message-ID: <20200806203914.GQ4295@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <87k0ybha0z.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87k0ybha0z.fsf@nanos.tec.linutronix.de> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 06, 2020 at 09:03:24PM +0200, Thomas Gleixner wrote: > Paul, > > "Paul E. McKenney" writes: > > On Thu, Aug 06, 2020 at 01:45:45PM +0200, peterz@infradead.org wrote: > >> The safety thing is concerned with RT tasks. It doesn't pretend to help > >> with runnaway IRQs, never has, never will. > > > > Getting into the time machine back to the 1990s... > > > > DYNIX/ptx had a discretionary mechanism to deal with excessive interrupts. > > There was a function that long-running interrupt handlers were supposed > > to call periodically that would return false if the system felt that > > the CPU had done enough interrupts for the time being. In that case, > > the interrupt handler was supposed to schedule itself for a later time, > > but leave the interrupt unacknowledged in order to prevent retriggering > > in the meantime. > > > > Of course, this mechanism would be rather less helpful in Linux. > > > > For one, Linux has way more device drivers and way more oddball devices. > > In contrast, the few devices that DYNIX/ptx supported were carefully > > selected, and the selection criteria included being able to put up > > with this sort of thing. Also, the fact that there was but a handful > > of device drivers meant that changes like this could be more easily > > propagated through all drivers. > > We could do that completely at the core interrupt handling level. Ah, true enough if the various NAPI-like devices give up the CPU from time to time. Which they might well do for all I know. > > Also, Linux supports way more workloads. In contrast, DYNIX/ptx could > > pick a small percentage of each CPU that would be permitted to be used > > by hardware interrupt handlers. As in there are probably Linux workloads > > that run >90% of some poor CPU within hardware interrupt handlers. > > Yet another tunable. /me runs ;-) ;-) ;-) If there are workloads that would like to be able to keep one or more CPUs completely busy handling interrupts, it should be possible to create something that is used sort of like cond_resched() to keep RCU, the scheduler, and the various watchdogs and lockup detectors at bay. For example, RCU could supply a function that checked to make sure that it was in an interrupt from idle, and if so report a quiescent state for that CPU. So if the CPU was idle and there wasn't anything pending for it, that CPU could safely stay in a hardirq handler indefinitely. I suppose that the function should return an indication in cases such as interrupt from non-idle. Sort of like NO_HZ_FULL, but for hardirq handlers, and also allowing those handlers to use RCU read-side critical sections. Or we could do what all the cool kids do these days, namely just apply machine learning, thus automatically self-tuning in real time. /me runs... Thanx, Paul