[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201108311545.14797.arnd@arndb.de>
Date: Wed, 31 Aug 2011 15:45:14 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Richard Kuo <rkuo@...eaurora.org>
Cc: linux-kernel@...r.kernel.org, linux-hexagon@...r.kernel.org
Subject: Re: [patch v2 15/35] Hexagon: Add init_task and process functions
On Tuesday 30 August 2011, Richard Kuo wrote:
> Fixed potential race-to-sleep condition in cpu_idle(). I hope.
>
> If called with interrupts disabled, our __vmwait() actually just returns
> without servicing it. Let me know if there's any other condition that
> I've missed...
The race should be gone now, but
> +void cpu_idle(void)
> +{
> + while (1) {
> + tick_nohz_stop_sched_tick(1);
> + local_irq_disable();
> + while (!need_resched()) {
> + idle_sleep();
> + /* interrupts wake us up, but aren't serviced */
> + local_irq_enable(); /* service interrupt */
> + local_irq_disable();
> + }
> + tick_nohz_restart_sched_tick();
> + schedule();
> + }
> +}
you now call schedule() with interrupts disabled, which isn't strictly
allowed.
I think it should all be fine if you write it as
while (1) {
tick_nohz_stop_sched_tick(1);
local_irq_disable();
while (!need_resched()) {
idle_sleep();
}
local_irq_enable();
tick_nohz_restart_sched_tick();
schedule();
}
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists