From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752173AbcBWKJW (ORCPT ); Tue, 23 Feb 2016 05:09:22 -0500 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:38554 "EHLO e23smtp02.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751217AbcBWKJU (ORCPT ); Tue, 23 Feb 2016 05:09:20 -0500 X-IBM-Helo: d23dlp01.au.ibm.com X-IBM-MailFrom: shreyas@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;linux-pm@vger.kernel.org Message-ID: <56CC2F90.4040008@linux.vnet.ibm.com> Date: Tue, 23 Feb 2016 15:38:16 +0530 From: Shreyas B Prabhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Daniel Lezcano CC: tglx@linutronix.de, peterz@infradead.org, rafael@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, nicolas.pitre@linaro.org, vincent.guittot@linaro.org Subject: Re: [PATCH V3 2/2] sched: idle: IRQ based next prediction for idle period References: <1455637383-14412-1-git-send-email-daniel.lezcano@linaro.org> <1455637383-14412-2-git-send-email-daniel.lezcano@linaro.org> <56CB22F5.8010808@linux.vnet.ibm.com> <56CB455C.3050701@linaro.org> In-Reply-To: <56CB455C.3050701@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16022310-0005-0000-0000-000003600442 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/2016 10:59 PM, Daniel Lezcano wrote: > On 02/22/2016 04:02 PM, Shreyas B Prabhu wrote: >> Hi Daniel, >> >> On 02/16/2016 09:13 PM, Daniel Lezcano wrote: >>> + >>> +/** >>> + * sched_idle_next_wakeup - Predict the next wakeup on the current cpu >>> + * >>> + * The next event on the cpu is based on a statistic approach of the >>> + * interrupt events and the timer deterministic value. From the timer >>> + * or the irqs, we return the one expected to occur first. >>> + * >>> + * Returns the expected remaining idle time before being woken up by >>> + * an interruption. >>> + */ >>> +s64 sched_idle_next_wakeup(void) >>> +{ >>> + s64 next_timer = ktime_to_us(tick_nohz_get_sleep_length()); >>> + s64 next_irq = next_irq_event(); >> >> Since next_irq_event() uses RCU and we are in idle this should probably >> be wrapped in RCU_NONIDLE(). > > That is a good point but the function is not supposed to be called in > the rcu_idle_enter/rcu_idle_exit section which is inside > cpuidle_idle_call(). > > Right. My bad.