Re: Question about x86/mm/gup.c's use of disabled interrupts

From: Paul E. McKenney
Date: Fri Mar 20 2009 - 11:57:43 EST


On Fri, Mar 20, 2009 at 08:38:46AM -0700, Jeremy Fitzhardinge wrote:
> Paul E. McKenney wrote:
>>> Ah, interesting. So disabling interrupts prevents the RCU free from
>>> happening, and non-atomic pte fetching is a non-issue. So it doesn't
>>> address the PAE side of the problem.
>>
>> This would be rcu_sched, correct?
>
> I guess? Whatever it is that ends up calling all the rcu callbacks after
> the idle. A cpu with disabled interrupts can't go through idle, right? Or
> is there an explicit way to hold off rcu?

For synchronize_rcu() and call_rcu(), the only guaranteed way to hold
off RCU is rcu_read_lock() and rcu_read_unlock().

For call_rcu_bh, the only guaranteed way to hold off RCU is
rcu_read_lock_bh() and rcu_read_unlock_bh().

For synchronize_srcu(), the only guaranteed way to hold off RCU is
srcu_read_lock() and srcu_read_unlock().

For synchronize_sched() and call_rcu_sched(), anything that disables
preemption, including disabling irqs, holds off RCU.

Although disabling irqs can indeed hold off RCU in some other cases,
the only guarantee is for synchronize_sched() and call_rcu_sched().

Thanx, Paul
--
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/