Re: [PATCH] 3/4 combine RCU with seqlock to allow mmu notifiermethods to sleep (#v9 was 1/4)

From: Peter Zijlstra
Date: Fri Mar 07 2008 - 11:53:21 EST


On Fri, 2008-03-07 at 16:23 +0100, Andrea Arcangeli wrote:


> @@ -42,11 +45,19 @@ int __mmu_notifier_clear_flush_young(str
> struct mmu_notifier *mn;
> struct hlist_node *n;
> int young = 0;
> + unsigned seq;
>
> rcu_read_lock();
> +restart:
> + seq = read_seqbegin(&mm->mmu_notifier_lock);
> hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_list, hlist) {
> - if (mn->ops->clear_flush_young)
> + if (mn->ops->clear_flush_young) {

hlist_del_rcu(&mn->hlist)

> + rcu_read_unlock();

kfree(mn);

> young |= mn->ops->clear_flush_young(mn, mm, address);

*BANG*

> + rcu_read_lock();
> + }
> + if (read_seqretry(&mm->mmu_notifier_lock, seq))
> + goto restart;
> }
> rcu_read_unlock();



--
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/