Re: [patch] voluntary-preempt-2.6.8-rc2-J3

Junio C Hamano
2004-07-27T08:28:33Z

>>>>> "AM" == Andrew Morton <akpm@osdl.org> writes:

AM> +#ifdef CONFIG_SMP
AM> +#define cond_resched_lock(lock, counter, limit) \
AM> + do { \
AM> + if (++(counter) >= limit) { \
AM> + spin_unlock(lock); \
AM> + cpu_relax(); \
AM> + spin_lock(lock); \
AM> + } \
AM> + (counter) = 0; \
AM> + } while (0)
AM> +#else

I am wondering if you meant to reset the counter to zero inside
of the if(){}, probably after reaquiring the lock...