lkml.org 
[lkml]   [2017]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH/RFC] llist: add llist_[add|del_first]_exclusive
Date
Vitaly Wool <vitalywool@gmail.com> writes:

> 2017-12-22 14:57 GMT+01:00 Huang, Ying <ying.huang@intel.com>:
>
>> Vitaly Wool <vitalywool@gmail.com> writes:
>>
>> > 2017-12-20 1:57 GMT+01:00 Huang, Ying <ying.huang@intel.com>:
>> >
>> > <snip>
>> >
>> >>
>> >> > Could you please elaborate how this would be implemented "on top"?
>> >>
>> >> struct llist_node *my_del_first_exclusive(struct llist_head *head)
>> >> {
>> >> struct llist_node *node = llist_del_first(head);
>> >>
>> >> if (node)
>> >> node->next = LLIST_NODE_UNLISTED;
>> >> }
>> >>
>> >> bool my_add_exclusive(struct llist_node *node, struct llist_head *head)
>> >> {
>> >> if (node->next != LLIST_NODE_UNLIST)
>> >> return false;
>> >> if (cmpxchg(&node->next, LLIST_NODE_UNLIST, NULL) !=
>> >> LLIST_NODE_UNLIST)
>> >> return false;
>> >> llist_add(node, head);
>> >> return true;
>> >> }
>> >>
>> >
>> > That would work, thanks. I'll update the patch.
>>
>> Is there any other users except your code? If no, I think it's better
>> to keep it with its only user instead part of llist library at least for
>> now. Because I don't know whether the usage model is popular.
>>
>>
>>
> I'm going to come up with a patch to binder that uses these specific
> extensions, so I expect there'll be some users for this.

I think it is better to keep this in binder unless there are other
users.

Best Regards,
Huang, Ying

> Thanks,
> Vitaly

\
 
 \ /
  Last update: 2017-12-28 01:48    [W:0.024 / U:2.860 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site