Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2485049imu; Tue, 6 Nov 2018 15:46:13 -0800 (PST) X-Google-Smtp-Source: AJdET5eGEMeFpNllJox1SH9zlAVo1cfV57oq1kjhtgBlhGV2T/508s40KLWLxwJR32EZHRkPTcF/ X-Received: by 2002:a62:d452:: with SMTP id u18-v6mr14435760pfl.32.1541547973105; Tue, 06 Nov 2018 15:46:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541547973; cv=none; d=google.com; s=arc-20160816; b=n8LfkGtQJCbdYNlCxJEMb91zEffDhNW3+Gi4OZfwy5u9IrdTobz669KQZDtnFdjPMv zoqkocyrrlTXaSdBwoA/ejOwodAwcNajMEspLHk7l4T6Gp/W3FzXzPY8LXhESyxdw+u9 wyhswDk8beD8oel5hZn+BRWNNIyVz4RFIlvETjy12rOvKhRmpZYu1NVebeDLgAAClZ7G PgGjXfY/1t8Z+nX0aedqBLnAzOZnVbjGJujXfDW+Sbluaz3XSU0Z4GoH96VX2UqyzdA8 OlVNNGknb90ytc/Z7nPQ6Bs453lwacPxAjbwihVNxgp5DWoJ66jKaOYr6zKN9vCFV5+y ijpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=S2KO6+1RSyzau/C640jmqGihOk9pii2ENU5KaGY+YZ0=; b=TtEwLqH94z2i3xxCvVu8k5h3RSDaeGELqytQk5MH8Tnucwq1FuflHwqlHX8L/b8eAn kmx3Qiohq/ak6jq99uxE55E3iaPxJbMo+RfxZl78lXc9Dv2a7xXivnXS3uadZP8XIxQq yx9BOA6WfXflSQ8QZWhIB4htKVUz3iZOOFL50lZri+lTB9luzX8fgDDcoCzEi/aqW9aN Ive0Hn6WihB9NL0eKRL1N8We8IGVVzAHZHVX3N8VEZRj1A/E+mRKICQYf6C1DNJUW6sN YTj4u9uyZZsjMgkVA2Jp2D+I9+8QjKKiTB70Cv9UgUof44HS4yi3LyTBnmNyQU6p5ADI MGHg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si7545720pgm.420.2018.11.06.15.45.58; Tue, 06 Nov 2018 15:46:13 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731041AbeKGJH1 (ORCPT + 99 others); Wed, 7 Nov 2018 04:07:27 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:46214 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730409AbeKGJH0 (ORCPT ); Wed, 7 Nov 2018 04:07:26 -0500 Received: by mail-oi1-f196.google.com with SMTP id k64-v6so12314877oia.13; Tue, 06 Nov 2018 15:39:44 -0800 (PST) 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=S2KO6+1RSyzau/C640jmqGihOk9pii2ENU5KaGY+YZ0=; b=ZuvrVWFcTf+Mbeltbkd/zMGQORenPH0aYwfAwqY63rJ8IOVEtVlSRsiX/3xQ/c1UhL hoo1xmCID0Yfw8a5hv0d5r49dtvFMjn+HtY3WYehDz7A4LLGIc4mbV+VcvjX5V4sgsd7 UI/L7fYx2sXc+8U2pwIUZjTgqJXp2i0RKjJyQQbueWz6a0qT+EtMBLgVg/0mCMgCCmK2 edRScoyUkzl3CfEvNIB2zlmmBDEFuo1DMTZwZJJwr85rW6W6MEZ+6+Dmiho9qdfqtqvH 8FxaqAf1P87u24dN2d1Hxspnd+FznthVEL8M/5DZWVXG2x1FTzc+wDDuEXa2O3ngNgQZ E/QA== X-Gm-Message-State: AGRZ1gKsC1VrZdaF7jyPcrGEFy/+JjqjGb+VEHbt51LWkoYEwk06coSX EuCeEBvJAIt/Nlc0xlGRMQXAcxQKMeKagMqI90yOGpjf X-Received: by 2002:aca:afd0:: with SMTP id y199-v6mr15481629oie.322.1541547583534; Tue, 06 Nov 2018 15:39:43 -0800 (PST) MIME-Version: 1.0 References: <1556808.yKVbhZSazi@aspire.rjw.lan> <20181106170442.GC9781@hirez.programming.kicks-ass.net> <20181106195127.GD9781@hirez.programming.kicks-ass.net> In-Reply-To: <20181106195127.GD9781@hirez.programming.kicks-ass.net> From: "Rafael J. Wysocki" Date: Wed, 7 Nov 2018 00:39:31 +0100 Message-ID: Subject: Re: [RFC/RFT][PATCH v3] cpuidle: New timer events oriented governor for tickless systems To: Peter Zijlstra Cc: "Rafael J. Wysocki" , "Rafael J. Wysocki" , Linux PM , Giovanni Gherdovich , Doug Smythies , Srinivas Pandruvada , Linux Kernel Mailing List , Frederic Weisbecker , Mel Gorman , Daniel Lezcano Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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. 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.