Commit a3f22fd7 authored by Thomas Gleixner's avatar Thomas Gleixner

sched: Convert thread_group_cputimer lock to atomic_spinlock

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 3847c2d9
......@@ -27,7 +27,7 @@ extern struct fs_struct init_fs;
.cputimer = { \
.cputime = INIT_CPUTIME, \
.running = 0, \
.lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
.lock = __ATOMIC_SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
}, \
}
......
......@@ -520,7 +520,7 @@ struct task_cputime {
struct thread_group_cputimer {
struct task_cputime cputime;
int running;
spinlock_t lock;
atomic_spinlock_t lock;
};
/*
......@@ -2321,7 +2321,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
static inline void thread_group_cputime_init(struct signal_struct *sig)
{
sig->cputimer.cputime = INIT_CPUTIME;
spin_lock_init(&sig->cputimer.lock);
atomic_spin_lock_init(&sig->cputimer.lock);
sig->cputimer.running = 0;
}
......
......@@ -279,7 +279,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);
atomic_spin_lock_irqsave(&cputimer->lock, flags);
if (!cputimer->running) {
cputimer->running = 1;
/*
......@@ -292,7 +292,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);
atomic_spin_unlock_irqrestore(&cputimer->lock, flags);
}
/*
......@@ -1065,9 +1065,9 @@ static void stop_process_timers(struct task_struct *tsk)
if (!cputimer->running)
return;
spin_lock_irqsave(&cputimer->lock, flags);
atomic_spin_lock_irqsave(&cputimer->lock, flags);
cputimer->running = 0;
spin_unlock_irqrestore(&cputimer->lock, flags);
atomic_spin_unlock_irqrestore(&cputimer->lock, flags);
}
/*
......
......@@ -306,10 +306,10 @@ static inline void account_group_user_time(struct task_struct *tsk,
if (!cputimer->running)
return;
spin_lock(&cputimer->lock);
atomic_spin_lock(&cputimer->lock);
cputimer->cputime.utime =
cputime_add(cputimer->cputime.utime, cputime);
spin_unlock(&cputimer->lock);
atomic_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);
atomic_spin_lock(&cputimer->lock);
cputimer->cputime.stime =
cputime_add(cputimer->cputime.stime, cputime);
spin_unlock(&cputimer->lock);
atomic_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);
atomic_spin_lock(&cputimer->lock);
cputimer->cputime.sum_exec_runtime += ns;
spin_unlock(&cputimer->lock);
atomic_spin_unlock(&cputimer->lock);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment