diff options
author | Sumit Singh <sumsingh@nvidia.com> | 2014-04-21 18:12:14 +0530 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2014-06-24 04:48:02 -0700 |
commit | a4936a69eeed7f060f6986036b0003667bde4a6f (patch) | |
tree | e55c7abbf4807f158475aad44c1971457800322d /include | |
parent | 6089b3610a5e400e6e049b73ae50d5d4d92f46bf (diff) |
seqlock: enhance power efficiency
Trying to improve the power efficiency in linux/seqlock.h,
using macros cpu_relaxed_read and cpu_read_relax.
Bug 1440421
Change-Id: I8dcc9dc9c72e5a6848c7823768c76f5d38e9f0d1
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/398943
(cherry picked from commit ed77ee4d50641b1a5668545c946cda681c06fcd2)
Reviewed-on: http://git-master/r/422258
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/seqlock.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 18299057402f..d4cf5229cc18 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -29,6 +29,7 @@ #include <linux/spinlock.h> #include <linux/preempt.h> #include <asm/processor.h> +#include <asm/relaxed.h> /* * Version using sequence counter only. @@ -61,9 +62,9 @@ static inline unsigned __read_seqcount_begin(const seqcount_t *s) unsigned ret; repeat: - ret = ACCESS_ONCE(s->sequence); + ret = cpu_relaxed_read((volatile u32 *)&s->sequence); if (unlikely(ret & 1)) { - cpu_relax(); + cpu_read_relax(); goto repeat; } return ret; |