Re: [PATCH] TOMOYO: Add garbage collector support. (v2)

Tetsuo Handa
2009-05-27T01:26:19Z

Hello.

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

Thanks.