From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752833AbdL1Arg (ORCPT ); Wed, 27 Dec 2017 19:47:36 -0500 Received: from mga03.intel.com ([134.134.136.65]:22771 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062AbdL1Arf (ORCPT ); Wed, 27 Dec 2017 19:47:35 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,468,1508828400"; d="scan'208";a="5661709" From: "Huang\, Ying" To: Vitaly Wool Cc: LKML , Subject: Re: [PATCH/RFC] llist: add llist_[add|del_first]_exclusive References: <20171218154651.777fb889c34259799bef3024@gmail.com> <87h8snv6sh.fsf@yhuang-dev.intel.com> <87bmiutdwf.fsf@yhuang-dev.intel.com> <87vagyj25v.fsf@yhuang-dev.intel.com> Date: Thu, 28 Dec 2017 08:47:33 +0800 In-Reply-To: (Vitaly Wool's message of "Tue, 26 Dec 2017 11:23:25 +0100") Message-ID: <87h8sbsmoq.fsf@yhuang-dev.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Vitaly Wool writes: > 2017-12-22 14:57 GMT+01:00 Huang, Ying : > >> Vitaly Wool writes: >> >> > 2017-12-20 1:57 GMT+01:00 Huang, Ying : >> > >> > >> > >> >> >> >> > 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