[lttng-dev] Query on the rculist

Lai Jiangshan eag0628 at gmail.com
Tue Jan 22 09:24:09 EST 2013


于 2013/1/21 22:16, Mathieu Desnoyers 写道:
> * Liu Yuan (namei.unix at gmail.com) wrote:
>> Hi List,
>>
>>     I noticed that there are just few functions suffixed with rcu for
>> rculist. And from the source of Linux kernel rculist, I came up with
>> some comments saying that list_empty_rcu() can be simply achieved by
>> calling list_empty(). Is this true to urcu too? My questions is, are
>> following equivalents true?
>>
>>    list_empty_rcu -> list_empty
>
> Yes.
>
>>    list_del_init_rcu -> list_del_init
>
> No.

Add a trivial comment.

There is no list_del_init_rcu(), "init" hurts "rcu".
If you need a re-initialized object after deletion, you should use
synchronzie_rcu():

list_del_rcu();
synchronize_rcu();
CDS_INIT_LIST_HEAD();

>
>>
>> If there are more equivalents, please show light on it.
>
> I will prepare a patch to extend and document the list and rculist APIs.
> Your feedback is welcome.
>
> Thanks!
>
> Mathieu
>
>>
>> Thanks,
>> Yuan
>




More information about the lttng-dev mailing list