Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2911656imu; Wed, 7 Nov 2018 01:29:54 -0800 (PST) X-Google-Smtp-Source: AJdET5cbWKQRQUurxwhWC58rx7hh5Bb1iqpWKKXR2hN+UJSCkebHjBg1+bf0lII4EG79CCjluM2y X-Received: by 2002:a63:214d:: with SMTP id s13-v6mr994795pgm.148.1541582994511; Wed, 07 Nov 2018 01:29:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541582994; cv=none; d=google.com; s=arc-20160816; b=Y7wgVs5GZWY5bmIffmz6gJv77X4XAwVYx3I4kzR0PBUU66p237irzVd0VK2g776R5T OIc6RlrMd2KdzkY8Eo/vhSpN7HnOFOJfc5X2NBAZu9tJIrUwBsc2DOfKYh6kD8NilVvO ASkUDf3lrCiTVyFyQsODSoPceKd7OPSXvWswszXJx7Fxl/N4YO8DXadQ4/DZRqeNLuST 27HQFbsqGPENMZVvVhWuL2Qvjaq3Nswp5uwsw9R3JZfzZXbcGyMvMfldbB4K/KEMjMls aXoEgzqnH87Iy6oMM4bGMJLL+FoD33bNcjPmHRjjLQ9o1DIS10BbWU4H/xMfCuu5TV4z swJA== 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:message-id:subject:cc :to:from:date:dkim-signature; bh=8YWMxjj5OCwP4xaGuR46tBO9eGmPGHKGyc50rtcYkwk=; b=WfuhMNGuvXOy3kxejaZR0I9tC24bTY+WLWMChvaHonn5i5+0+ERuf+wsYDYmcKnd/F p+V9X0iAU9sDb3+I+7FYrIRt5hApizVB9aIV/GJ485UojTI0WemJ0WJ+O8nFhJYoVK8B H/mxA4z5dyMOqPV9nZ/gRMwcwzRH1q3QIQc42ezeuaW9uRD7ZmldPobFJkJzZ8jI/58S WJhVdZQC1mqJ7fHhlYVn/BzZ54GDSgGEdRef5zXpwiDFEHuOOT5mbVTjQzd3byYZIZdb 7NwZ4wRSyCsAlXZ0lD2XJW5N848EKjRR03JfPCCcVPf+tBxYfYotwylr17rysrrBRZm0 E6Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="Hs072k/t"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15si61573pgf.321.2018.11.07.01.29.38; Wed, 07 Nov 2018 01:29:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="Hs072k/t"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730618AbeKGS3Q (ORCPT + 99 others); Wed, 7 Nov 2018 13:29:16 -0500 Received: from merlin.infradead.org ([205.233.59.134]:54282 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726357AbeKGS3P (ORCPT ); Wed, 7 Nov 2018 13:29:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8YWMxjj5OCwP4xaGuR46tBO9eGmPGHKGyc50rtcYkwk=; b=Hs072k/tH3biSPs9VLxHpZmgs ThcEoQgxIW13ZoixLTIPBcwAfr2FprYCleVnWo0FqYetxfWtvXH4bfekXHMD8c2GqLRp+7KDGqV6h YneOmqFaZJsz0tYBW2FLhdzBGPUKvAuCqndjuFtUEbUeVg8joqK6Q+dK2GQ7BfJjcMI36dBIBP5dg RZ6jrD9PI8KzOeRS273jP+14wHwOO/Hx1mPn2u/sUhJ9X2fmE42hRy8dIp3Nu/7DighEsrWVhUqxG GwEw3+CX9/A0clHzl4w6mJLKdjlNLIMCP/77lhELP/EgCSQmyYFln26Pp7M4z9+IQ/bItYIcPbvzy 0L0N/mejw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gKJgZ-0003Sq-Id; Wed, 07 Nov 2018 08:59:39 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4CAC920284C61; Wed, 7 Nov 2018 09:59:36 +0100 (CET) Date: Wed, 7 Nov 2018 09:59:36 +0100 From: Peter Zijlstra To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux PM , Giovanni Gherdovich , Doug Smythies , Srinivas Pandruvada , Linux Kernel Mailing List , Frederic Weisbecker , Mel Gorman , Daniel Lezcano Subject: Re: [RFC/RFT][PATCH v3] cpuidle: New timer events oriented governor for tickless systems Message-ID: <20181107085936.GI9781@hirez.programming.kicks-ass.net> References: <1556808.yKVbhZSazi@aspire.rjw.lan> <20181106170442.GC9781@hirez.programming.kicks-ass.net> <20181106195127.GD9781@hirez.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.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 07, 2018 at 12:39:31AM +0100, Rafael J. Wysocki wrote: > On Tue, Nov 6, 2018 at 8:51 PM Peter Zijlstra wrote: > > > > On Tue, Nov 06, 2018 at 07:19:24PM +0100, Rafael J. Wysocki wrote: > > > On Tue, Nov 6, 2018 at 6:04 PM Peter Zijlstra wrote: > > > > > > Instead of this detector; why haven't you used the code from > > > > kernel/irq/timings.c ? > > > > > > Because it doesn't help much AFAICS. > > > > > > Wakeups need not be interrupts in particular > > > > You're alluding to the MWAIT wakeup through the MONITOR address ? > > Yes. Right, those will not be accounted for and will need something else. > > > and interrupt patterns that show up when the CPU is busy may not be > > > relevant for when it is idle. > > > > I think that is not always true; consider things like the periodic > > interrupt from frame rendering or audio; if there is nothing more going > > on in the system than say playing your favourite tune, it gets the > > 'need more data soon' interrupt from the audio card, wakes up, does a little > > mp3/flac/ogg/whatever decode to fill up the buffer and goes back to > > sleep. Same for video playback I assume, the vsync interrupt for buffer > > flips is fairly predictable. > > > > The interrupt predictor we have in kernel/irq/timings.c should be very > > accurate in predicting those interrupts. > > In the above case the interrupts should produce a detectable pattern > of wakeups anyway. Ah, not so. Suppose you have both the audio and video interrupt going at a steady rate but different rate, then the combined pattern isn't trivial at all. > In general, however, I need to be convinced that interrupts that > didn't wake up the CPU from idle are relevant for next wakeup > prediction. I see that this may be the case, but to what extent is > rather unclear to me and it looks like calling > irq_timings_next_event() would add considerable overhead. How about we add a (debug) knob so that people can play with it for now? If it turns out to be useful, we'll learn.