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

From: Tetsuo Handa
Date: Mon Jun 01 2009 - 21:17:25 EST


Serge E. Hallyn wrote:
> All readers should walk the list under rcu_read_lock, so if the manage
> to reach ->entry, then entry.list->next will be a valid entry on the live
> list until the next rcu cycle.

I have to tell you one thing.
Reader traverses the list via read(2) system call.
It means that reader can't read all elements in the list within a single
read(2) system call.
Thus, reader grabs a reference on an element (i.e. p->entry.users) before
leaving reader section and drops that reference after entering reader section.

Yes, it would be possible for readers to walk the list under rcu_read_lock(),
but it is not sufficient for GC to simply call synchronize_rcu(). GC has to
wait for p->entry.users to become 0 before modifying p->entry.list.next .

> BTW I'm not telling you have to do this, so if you just don't want to, then
> just say so. But so long as you come back to me with technical reasons
> why you can't, then I take it you're interested in a technical solution :)
> and can't help but respond...

I see. I'll post only (1) and (2).

Thank you for your suggestion and time.
--
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/