lkml.org 
[lkml]   [2015]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] sched, timer: Use atomics for thread_group_cputimer to improve scalability
On 04/15/2015 04:39 AM, Jason Low wrote:
> /*
> @@ -885,11 +890,8 @@ static void check_thread_timers(struct task_struct *tsk,
> static void stop_process_timers(struct signal_struct *sig)
> {
> struct thread_group_cputimer *cputimer = &sig->cputimer;
> - unsigned long flags;
>
> - raw_spin_lock_irqsave(&cputimer->lock, flags);
> - cputimer->running = 0;
> - raw_spin_unlock_irqrestore(&cputimer->lock, flags);
> + WRITE_ONCE(cputimer->running, 0);

Why do a WRITE_ONCE() here ? Maybe you should explicitly mention this
through a comment like Steven pointed out about all
WRITE/READ/ACCESS_ONCE() usage.

Regards
Preeti U Murthy
> }
>
> static u32 onecputick;
> @@ -1114,9 +1116,7 @@ static inline int fastpath_timer_check(struct task_struct *tsk)
> if (sig->cputimer.running) {
> struct task_cputime group_sample;
>
> - raw_spin_lock(&sig->cputimer.lock);
> - group_sample = sig->cputimer.cputime;
> - raw_spin_unlock(&sig->cputimer.lock);
> + sample_group_cputimer(&group_sample, &sig->cputimer);
>
> if (task_cputime_expired(&group_sample, &sig->cputime_expires))
> return 1;
>



\
 
 \ /
  Last update: 2015-04-15 13:21    [W:0.208 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site