Re: [patch 1/6] mmu_notifier: Core code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, February 5, 2008 - 11:17 am

On Tue, 2008-02-05 at 18:05 +0000, Andy Whitcroft wrote:


That is not quite so, list elements must be preserved, not the list
order.


Yeah, has been noticed, read on in the thread :-)


It does make sense, hlist_del_rcu() maintains the fwd reference, but it
does unlink it from the list proper. As long as there is a write side
exclusion around the actual removal as you noted.

rcu_read_lock();
hlist_for_each_entry_safe_rcu(tpos, pos, n, head, member) {

	if (foo) {
		spin_lock(write_lock);
		hlist_del_rcu(tpos);
		spin_unlock(write_unlock);
	}
}
rcu_read_unlock();

is a safe construct in that the list itself stays a proper list, and
even items that might be caught in the to-be-deleted entries will have a
fwd way out.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Mon Jan 28, 1:28 pm)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Mon Jan 28, 3:06 pm)
Re: [patch 1/6] mmu_notifier: Core code, Robin Holt, (Mon Jan 28, 5:05 pm)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Mon Jan 28, 6:19 pm)
Re: [patch 1/6] mmu_notifier: Core code, Andrea Arcangeli, (Tue Jan 29, 6:59 am)
Re: [patch 1/6] mmu_notifier: Core code, Andrea Arcangeli, (Tue Jan 29, 7:34 am)
Re: [patch 1/6] mmu_notifier: Core code, Robin Holt, (Tue Jan 29, 9:07 am)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Tue Jan 29, 12:49 pm)
Re: [patch 1/6] mmu_notifier: Core code, Avi Kivity, (Tue Jan 29, 1:41 pm)
Re: [patch 1/6] mmu_notifier: Core code, Andy Whitcroft, (Tue Feb 5, 11:05 am)
Re: [patch 1/6] mmu_notifier: Core code, Peter Zijlstra, (Tue Feb 5, 11:17 am)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Tue Feb 5, 11:19 am)