| From faf5a36c0f61e4441c779a659c7931211625f55c Mon Sep 17 00:00:00 2001 |
| From: Thomas Gleixner <tglx@linutronix.de> |
| Date: Sat, 25 Jul 2009 18:56:56 +0200 |
| Subject: [PATCH] sched: Convert thread_group_cputimer lock to raw_spinlock |
| |
| commit a3f22fd7ae186a29b413ad959184f9b4c1d32173 in tip. |
| |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| --- |
| include/linux/init_task.h | 2 +- |
| include/linux/sched.h | 4 ++-- |
| kernel/posix-cpu-timers.c | 8 ++++---- |
| kernel/sched_stats.h | 12 ++++++------ |
| 4 files changed, 13 insertions(+), 13 deletions(-) |
| |
| diff --git a/include/linux/init_task.h b/include/linux/init_task.h |
| index b1ed1cd..e13501e 100644 |
| --- a/include/linux/init_task.h |
| +++ b/include/linux/init_task.h |
| @@ -27,7 +27,7 @@ extern struct fs_struct init_fs; |
| .cputimer = { \ |
| .cputime = INIT_CPUTIME, \ |
| .running = 0, \ |
| - .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ |
| + .lock = __RAW_SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ |
| }, \ |
| } |
| |
| diff --git a/include/linux/sched.h b/include/linux/sched.h |
| index 58478ea..a993aa5 100644 |
| --- a/include/linux/sched.h |
| +++ b/include/linux/sched.h |
| @@ -511,7 +511,7 @@ struct task_cputime { |
| struct thread_group_cputimer { |
| struct task_cputime cputime; |
| int running; |
| - spinlock_t lock; |
| + raw_spinlock_t lock; |
| }; |
| |
| /* |
| @@ -2401,7 +2401,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times); |
| |
| static inline void thread_group_cputime_init(struct signal_struct *sig) |
| { |
| - spin_lock_init(&sig->cputimer.lock); |
| + raw_spin_lock_init(&sig->cputimer.lock); |
| } |
| |
| static inline void thread_group_cputime_free(struct signal_struct *sig) |
| diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c |
| index bc7704b..8997bd7 100644 |
| --- a/kernel/posix-cpu-timers.c |
| +++ b/kernel/posix-cpu-timers.c |
| @@ -280,7 +280,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times) |
| struct task_cputime sum; |
| unsigned long flags; |
| |
| - spin_lock_irqsave(&cputimer->lock, flags); |
| + raw_spin_lock_irqsave(&cputimer->lock, flags); |
| if (!cputimer->running) { |
| cputimer->running = 1; |
| /* |
| @@ -293,7 +293,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times) |
| update_gt_cputime(&cputimer->cputime, &sum); |
| } |
| *times = cputimer->cputime; |
| - spin_unlock_irqrestore(&cputimer->lock, flags); |
| + raw_spin_unlock_irqrestore(&cputimer->lock, flags); |
| } |
| |
| /* |
| @@ -1069,9 +1069,9 @@ static void stop_process_timers(struct signal_struct *sig) |
| if (!cputimer->running) |
| return; |
| |
| - spin_lock_irqsave(&cputimer->lock, flags); |
| + raw_spin_lock_irqsave(&cputimer->lock, flags); |
| cputimer->running = 0; |
| - spin_unlock_irqrestore(&cputimer->lock, flags); |
| + raw_spin_unlock_irqrestore(&cputimer->lock, flags); |
| |
| sig->cputime_expires.prof_exp = cputime_zero; |
| sig->cputime_expires.virt_exp = cputime_zero; |
| diff --git a/kernel/sched_stats.h b/kernel/sched_stats.h |
| index 32d2bd4..9ecca2f 100644 |
| --- a/kernel/sched_stats.h |
| +++ b/kernel/sched_stats.h |
| @@ -306,10 +306,10 @@ static inline void account_group_user_time(struct task_struct *tsk, |
| if (!cputimer->running) |
| return; |
| |
| - spin_lock(&cputimer->lock); |
| + raw_spin_lock(&cputimer->lock); |
| cputimer->cputime.utime = |
| cputime_add(cputimer->cputime.utime, cputime); |
| - spin_unlock(&cputimer->lock); |
| + raw_spin_unlock(&cputimer->lock); |
| } |
| |
| /** |
| @@ -336,10 +336,10 @@ static inline void account_group_system_time(struct task_struct *tsk, |
| if (!cputimer->running) |
| return; |
| |
| - spin_lock(&cputimer->lock); |
| + raw_spin_lock(&cputimer->lock); |
| cputimer->cputime.stime = |
| cputime_add(cputimer->cputime.stime, cputime); |
| - spin_unlock(&cputimer->lock); |
| + raw_spin_unlock(&cputimer->lock); |
| } |
| |
| /** |
| @@ -369,7 +369,7 @@ static inline void account_group_exec_runtime(struct task_struct *tsk, |
| if (!cputimer->running) |
| return; |
| |
| - spin_lock(&cputimer->lock); |
| + raw_spin_lock(&cputimer->lock); |
| cputimer->cputime.sum_exec_runtime += ns; |
| - spin_unlock(&cputimer->lock); |
| + raw_spin_unlock(&cputimer->lock); |
| } |
| -- |
| 1.7.0.4 |
| |