Re: [PATCH 2/2] sched,misc: Use schedule_(raw_)spin_unlock andschedule_(raw_)spin_unlock_irq

From: Steven Rostedt
Date: Tue Jun 18 2013 - 11:56:58 EST


On Tue, 2013-06-18 at 19:36 +0400, Kirill Tkhai wrote:
> diff --git a/include/linux/wait.h b/include/linux/wait.h
> index f487a47..f0ab843 100644
> --- a/include/linux/wait.h
> +++ b/include/linux/wait.h
> @@ -474,10 +474,9 @@ do
> { \
> break; \
> } \
> if
> (irq) \
> - spin_unlock_irq(&(wq).lock); \
> + schedule_spin_unlock_irq(&(wq).lock); \
> else \
> - spin_unlock(&(wq).lock); \
> - schedule(); \
> + schedule_spin_unlock(&(wq).lock); \
> if
> (irq) \
> spin_lock_irq(&(wq).lock); \
> else


In this part, I would clean it up as:

if (irq) {
schedule_spin_unlock_irq(&(wq).lock)
spin_lock_irq(&(wq).lock);
} else {
schedule_spin_unlock(&(wq).lock);
spin_lock(&(wq).lock);
}

The old way just had a single call to schedule. The new way has two
different calls to schedule via the helper functions. No need to have
two if statements for that.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/