Re: [PATCH] TOMOYO: Add garbage collector support. (v2)
From: Tetsuo Handa
Date: Tue May 26 2009 - 21:26:23 EST
Paul E. McKenney wrote:
> The list_del_rcu() primitive is designed for removing elements from
> lists that have concurrent readers, and it therefore avoids changing the
> ->next pointer. That said, I don't immediately see whether or not there
> is some other reason you need to keep it on the list. And do you need
> the ->prev pointer to stay valid? If not, you might be able to use it
> in place of the ->is_deleted flag.
I don't need ->prev pointer.
> > Use of RCU does not help here because we need to keep the item valid as long as
> > the item is referred by ->read_var1 or ->read_var2 or ->write_var1 .
> You would indeed need some way of tracking those references. One
> approach is to make the RCU callback check to see if any of them
> reference the to-be-deleted object, reposting itself if so. This
> approach assumes that such a reference is short-lived, of course.
> If the ->read_var1 and other references are long-lived, could you
> post an RCU callback when the last such reference was removed?
The reference stored in ->read_var1 / ->read_var2 / ->write_var1 are long-lived
(it varies from less than one second to more than many hours).
Well, it's time for me to read all Documentation/RCU/* .
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/