Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162768AbbKTMyt (ORCPT ); Fri, 20 Nov 2015 07:54:49 -0500 Received: from casper.infradead.org ([85.118.1.10]:32795 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760165AbbKTMys (ORCPT ); Fri, 20 Nov 2015 07:54:48 -0500 Date: Fri, 20 Nov 2015 13:54:41 +0100 From: Peter Zijlstra To: Thomas Gleixner Cc: Morten Rasmussen , Arjan van de Ven , Jacob Pan , Ingo Molnar , John Stultz , LKML , Srinivas Pandruvada , Len Brown , Rafael Wysocki , Eduardo Valentin , Paul Turner Subject: Re: [PATCH 3/4] sched: introduce synchronized idle injection Message-ID: <20151120125441.GD17308@twins.programming.kicks-ass.net> References: <1447444387-23525-1-git-send-email-jacob.jun.pan@linux.intel.com> <1447444387-23525-4-git-send-email-jacob.jun.pan@linux.intel.com> <20151118154457.GD30184@e105550-lin.cambridge.arm.com> <564C9E93.8030901@linux.intel.com> <20151119172405.GA798@e105550-lin.cambridge.arm.com> <20151119200906.GS3816@twins.programming.kicks-ass.net> <20151120102014.GC17308@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1533 Lines: 40 On Fri, Nov 20, 2015 at 11:58:12AM +0100, Thomas Gleixner wrote: > That's not what I meant. If you don't want to control all that from > the scheduler than you are back to that thread which "runs" at RT > priority and does > > if (machine_on_fire) { > defer_timer_interrupt(5ms); > end = now + 5ms: > while (now < end) > mwait(); > } > > That's what the existing code does, but the above does not longer > claim it's idle and confuses the hell out of nohz and whatever. It's > just a "runaway" RT task which "hogs" the CPU for 5ms and makes the > next timer interrupt firing late. Right; so the naive way of implementing that is by simply programing the timer hardware 5ms in the future and leaving it at that. The problem with that would be a device interrupt happening and mucking with timers, this would result in the timer hardware being reprogrammed to a 'sane' value. I see two solutions for that: - add another check in tick_program_event(); or, - muck about with the evtdev pointer, such that we (temporarily) neuter its clock_event_device::set_next_*() methods. The later is fugly, but avoids any runtime overhead. This all makes the idle-injection muck hard depend on hres_active, but I think that's a sane constraint anyway. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/