diff options
author | Sumit Singh <sumsingh@nvidia.com> | 2014-04-21 15:22:15 +0530 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2014-06-24 04:48:06 -0700 |
commit | fc73b874a454561ec98314dfd508e767153fa4d7 (patch) | |
tree | 4c420ec6a6df760244260256ec7b026b7ffe108e | |
parent | c59d2989479d6431f4e83e2829c6cf25fc3f1184 (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>
-rw-r--r-- | include/linux/llist.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/llist.h b/include/linux/llist.h index a5199f6d0e82..30019d8fa4e2 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; @@ -137,6 +138,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; |