[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1247753686.6586.20.camel@laptop>
Date: Thu, 16 Jul 2009 16:14:46 +0200
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Ingo Molnar <mingo@...e.hu>, LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 4/7] sched: Add a preempt count base offset to
__might_sleep()
On Thu, 2009-07-16 at 02:28 -0400, Frederic Weisbecker wrote:
> +++ b/include/linux/hardirq.h
> @@ -103,6 +103,13 @@
> */
> #define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_INATOMIC_BASE)
>
> +static inline int current_preempt_equals(int preempt_offset)
> +{
> + int nested = preempt_count() & ~PREEMPT_ACTIVE;
> +
> + return (nested == PREEMPT_INATOMIC_BASE + preempt_offset);
> +}
I'm not sure about it being in hardirq.h, I think we should keep this in
sched.c.
Also, I'm not sure about the name, but then I suck at naming too. How
about something like: preempt_count_equals() ?
Other than that the series looks nice and I've got it queued.
--
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