Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfea4ae5 authored by Tengfei Fan's avatar Tengfei Fan
Browse files

ANDROID: cpufreq: times: Have two spinlock in different cache line



task_time_in_state_lock and uid_lock currently is
very possiblly in same cache line that will cause
livelock if 2 cores in contention.

Change-Id: I644687c4d610af5e84a43f422a711d386d6d5181
Signed-off-by: default avatarTengfei Fan <tengfeif@codeaurora.org>
parent 5084762c
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -29,8 +29,10 @@


static DECLARE_HASHTABLE(uid_hash_table, UID_HASH_BITS);
static DECLARE_HASHTABLE(uid_hash_table, UID_HASH_BITS);


static DEFINE_SPINLOCK(task_time_in_state_lock); /* task->time_in_state */
/* task->time_in_state */
static DEFINE_SPINLOCK(uid_lock); /* uid_hash_table */
static  __cacheline_aligned_in_smp DEFINE_SPINLOCK(task_time_in_state_lock);
/* uid_hash_table */
static __cacheline_aligned_in_smp DEFINE_SPINLOCK(uid_lock);


struct concurrent_times {
struct concurrent_times {
	atomic64_t active[NR_CPUS];
	atomic64_t active[NR_CPUS];