aboutsummaryrefslogtreecommitdiff
path: root/include/linux/llist.h
diff options
context:
space:
mode:
authorSumit Singh <sumsingh@nvidia.com>2014-04-21 15:22:15 +0530
committerMoyster <oysterized@gmail.com>2016-09-10 12:07:11 +0200
commit456d57a4dffc3231b7fe10714189736cf53c3320 (patch)
tree16c948ace7f397af5ff86a8cdc6ccbcf5c00acf4 /include/linux/llist.h
parentc1c7b649b4bc072415cca262c96a0d1181572fd5 (diff)
llist: defining relaxed version of llist_empty
Defining relaxed version of llist_empty as llist_empty_relaxed, which will be used for power-optimization. bug 1440421 Change-Id: I1c4c34b381e49775ed08ddd606d9744a7e7e1fba Signed-off-by: Sumit Singh <sumsingh@nvidia.com> Reviewed-on: http://git-master/r/426483 Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com> Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Diffstat (limited to 'include/linux/llist.h')
-rw-r--r--include/linux/llist.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/llist.h b/include/linux/llist.h
index 97cf31da6..197228346 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -57,6 +57,7 @@
#include <linux/kernel.h>
#include <asm/cmpxchg.h>
+#include <asm/relaxed.h>
struct llist_head {
struct llist_node *first;
@@ -160,6 +161,11 @@ static inline bool llist_empty(const struct llist_head *head)
return ACCESS_ONCE(head->first) == NULL;
}
+static inline bool llist_empty_relaxed(const struct llist_head *head)
+{
+ return (void *)cpu_relaxed_read_long(&head->first) == NULL;
+}
+
static inline struct llist_node *llist_next(struct llist_node *node)
{
return node->next;