From 6828533fa3e784626e69286b6c99379a1314b597 Mon Sep 17 00:00:00 2001 From: Sangkyu Kim Date: Mon, 10 Jun 2019 19:12:52 +0900 Subject: [PATCH] cpufreq_times: fix conflict to support cpufreq_times Change-Id: I7a2c8cbc505ba8ef63ddce690e235e26f0e56706 Signed-off-by: Sangkyu Kim Reviewed-on: https://gerrit.mot.com/1369616 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Hua Tan Submit-Approved: Jira Key --- drivers/cpufreq/cpufreq_times.c | 37 --------------------------------- 1 file changed, 37 deletions(-) diff --git a/drivers/cpufreq/cpufreq_times.c b/drivers/cpufreq/cpufreq_times.c index f332c5f21861..a43eeee30e8e 100644 --- a/drivers/cpufreq/cpufreq_times.c +++ b/drivers/cpufreq/cpufreq_times.c @@ -15,23 +15,16 @@ #include #include -<<<<<<< HEAD -#include -======= #include #include #include #include ->>>>>>> 818299f6bdae #include #include #include #include #include -<<<<<<< HEAD -static DEFINE_SPINLOCK(task_time_in_state_lock); /* task->time_in_state */ -======= #define UID_HASH_BITS 10 static DECLARE_HASHTABLE(uid_hash_table, UID_HASH_BITS); @@ -46,7 +39,6 @@ struct uid_entry { struct rcu_head rcu; u64 time_in_state[0]; }; ->>>>>>> 818299f6bdae /** * struct cpu_freqs - per-cpu frequency information @@ -66,13 +58,6 @@ static struct cpu_freqs *all_freqs[NR_CPUS]; static unsigned int next_offset; -<<<<<<< HEAD -void cpufreq_task_times_init(struct task_struct *p) -{ - void *temp; - unsigned long flags; - unsigned int max_state; -======= /* Caller must hold rcu_read_lock() */ static struct uid_entry *find_uid_entry_rcu(uid_t uid) @@ -250,16 +235,11 @@ static int uid_time_in_state_seq_show(struct seq_file *m, void *v) void cpufreq_task_times_init(struct task_struct *p) { unsigned long flags; ->>>>>>> 818299f6bdae spin_lock_irqsave(&task_time_in_state_lock, flags); p->time_in_state = NULL; spin_unlock_irqrestore(&task_time_in_state_lock, flags); p->max_state = 0; -<<<<<<< HEAD - - max_state = READ_ONCE(next_offset); -======= } void cpufreq_task_times_alloc(struct task_struct *p) @@ -267,7 +247,6 @@ void cpufreq_task_times_alloc(struct task_struct *p) void *temp; unsigned long flags; unsigned int max_state = READ_ONCE(next_offset); ->>>>>>> 818299f6bdae /* We use one array to avoid multiple allocs per task */ temp = kcalloc(max_state, sizeof(p->time_in_state[0]), GFP_ATOMIC); @@ -301,12 +280,9 @@ void cpufreq_task_times_exit(struct task_struct *p) unsigned long flags; void *temp; -<<<<<<< HEAD -======= if (!p->time_in_state) return; ->>>>>>> 818299f6bdae spin_lock_irqsave(&task_time_in_state_lock, flags); temp = p->time_in_state; p->time_in_state = NULL; @@ -350,13 +326,9 @@ void cpufreq_acct_update_power(struct task_struct *p, u64 cputime) { unsigned long flags; unsigned int state; -<<<<<<< HEAD - struct cpu_freqs *freqs = all_freqs[task_cpu(p)]; -======= struct uid_entry *uid_entry; struct cpu_freqs *freqs = all_freqs[task_cpu(p)]; uid_t uid = from_kuid_munged(current_user_ns(), task_uid(p)); ->>>>>>> 818299f6bdae if (!freqs || p->flags & PF_EXITING) return; @@ -368,15 +340,12 @@ void cpufreq_acct_update_power(struct task_struct *p, u64 cputime) p->time_in_state) p->time_in_state[state] += cputime; spin_unlock_irqrestore(&task_time_in_state_lock, flags); -<<<<<<< HEAD -======= spin_lock_irqsave(&uid_lock, flags); uid_entry = find_or_register_uid_locked(uid); if (uid_entry && state < uid_entry->max_state) uid_entry->time_in_state[state] += cputime; spin_unlock_irqrestore(&uid_lock, flags); ->>>>>>> 818299f6bdae } void cpufreq_times_create_policy(struct cpufreq_policy *policy) @@ -418,8 +387,6 @@ void cpufreq_times_create_policy(struct cpufreq_policy *policy) all_freqs[cpu] = freqs; } -<<<<<<< HEAD -======= void cpufreq_task_times_remove_uids(uid_t uid_start, uid_t uid_end) { struct uid_entry *uid_entry; @@ -441,7 +408,6 @@ void cpufreq_task_times_remove_uids(uid_t uid_start, uid_t uid_end) spin_unlock_irqrestore(&uid_lock, flags); } ->>>>>>> 818299f6bdae void cpufreq_times_record_transition(struct cpufreq_freqs *freq) { int index; @@ -461,8 +427,6 @@ void cpufreq_times_record_transition(struct cpufreq_freqs *freq) cpufreq_cpu_put(policy); } -<<<<<<< HEAD -======= static const struct seq_operations uid_time_in_state_seq_ops = { .start = uid_seq_start, @@ -498,4 +462,3 @@ static int __init cpufreq_times_init(void) } early_initcall(cpufreq_times_init); ->>>>>>> 818299f6bdae -- 2.20.1