2002-09-23 19:11:05

by Andrew Morton

[permalink] [raw]
Subject: Re: 2.5.38-mm2 [PATCH]

Dipankar Sarma wrote:
>
> ...
> -#ifdef CONFIG_PREEMPTION
> +#ifdef CONFIG_PREEMPT
> #define rcu_read_lock() preempt_disable()
> #define rcu_read_unlock() preempt_enable()
> #else

Thanks. I just replaced

#ifdef CONFIG_PREEMPTION
#define rcu_read_lock() preempt_disable()
#define rcu_read_unlock() preempt_enable()
#else
#define rcu_read_lock() do {} while(0)
#define rcu_read_unlock() do {} while(0)
#endif

with

#define rcu_read_lock() preempt_disable()
#define rcu_read_unlock() preempt_enable()

because preempt_disable() is a no-op on CONFIG_PREEMPT=n anyway.


2002-09-23 19:11:05

by Dipankar Sarma

[permalink] [raw]
Subject: Re: 2.5.38-mm2 [PATCH]

On Mon, Sep 23, 2002 at 09:28:41AM -0700, Andrew Morton wrote:
> #ifdef CONFIG_PREEMPTION
> #define rcu_read_lock() preempt_disable()
> #define rcu_read_unlock() preempt_enable()
> #else
> #define rcu_read_lock() do {} while(0)
> #define rcu_read_unlock() do {} while(0)
> #endif
>
> with
>
> #define rcu_read_lock() preempt_disable()
> #define rcu_read_unlock() preempt_enable()
>
> because preempt_disable() is a no-op on CONFIG_PREEMPT=n anyway.

This is fine. The original rcu_ltimer patch needed #ifdef CONFIG_PREEMPT,
so that it could be easily used with 2.4. With preemption in 2.5,
rcu_read_xxx() can be preempt_xxx().

Thanks
--
Dipankar Sarma <[email protected]> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.