From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752485AbcBVR3G (ORCPT ); Mon, 22 Feb 2016 12:29:06 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:36682 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbcBVR3E (ORCPT ); Mon, 22 Feb 2016 12:29:04 -0500 Subject: Re: [PATCH V3 2/2] sched: idle: IRQ based next prediction for idle period To: Shreyas B Prabhu 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> 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 From: Daniel Lezcano Message-ID: <56CB455C.3050701@linaro.org> Date: Mon, 22 Feb 2016 18:29:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56CB22F5.8010808@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog