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

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andy Whitcroft <apw@...>
Cc: Christoph Lameter <clameter@...>, Andrea Arcangeli <andrea@...>, Robin Holt <holt@...>, Avi Kivity <avi@...>, Izik Eidus <izike@...>, Nick Piggin <npiggin@...>, <kvm-devel@...>, Benjamin Herrenschmidt <benh@...>, <steiner@...>, <linux-kernel@...>, <linux-mm@...>, <daniel.blueman@...>, Hugh Dickins <hugh@...>
Date: Tuesday, February 5, 2008 - 2:17 pm

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, 4:28 pm)
Re: [patch 1/6] mmu_notifier: Core code, Andy Whitcroft, (Tue Feb 5, 2:05 pm)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Tue Feb 5, 2:19 pm)
Re: [patch 1/6] mmu_notifier: Core code, Peter Zijlstra, (Tue Feb 5, 2:17 pm)
Re: [patch 1/6] mmu_notifier: Core code, Robin Holt, (Tue Jan 29, 12:07 pm)
Re: [patch 1/6] mmu_notifier: Core code, Andrea Arcangeli, (Tue Jan 29, 9:59 am)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Tue Jan 29, 3:49 pm)
Re: [patch 1/6] mmu_notifier: Core code, Avi Kivity, (Tue Jan 29, 4:41 pm)
Re: [patch 1/6] mmu_notifier: Core code, Andrea Arcangeli, (Tue Jan 29, 10:34 am)
Re: [patch 1/6] mmu_notifier: Core code, Robin Holt, (Mon Jan 28, 8:05 pm)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Mon Jan 28, 9:19 pm)
Re: [patch 1/6] mmu_notifier: Core code, Christoph Lameter, (Mon Jan 28, 6:06 pm)