[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160907065057.GM10168@twins.programming.kicks-ass.net>
Date: Wed, 7 Sep 2016 08:50:57 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Stanislaw Gruszka <sgruszka@...hat.com>
Cc: linux-kernel@...r.kernel.org,
Giovanni Gherdovich <ggherdovich@...e.cz>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Mike Galbraith <mgalbraith@...e.de>,
Paolo Bonzini <pbonzini@...hat.com>,
Rik van Riel <riel@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Wanpeng Li <wanpeng.li@...mail.com>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH v3] sched/cputime: Protect some other sum_exec_runtime
reads on 32 bit cpus
On Tue, Sep 06, 2016 at 09:01:29PM +0200, Peter Zijlstra wrote:
> > diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
> > index 39008d7..a2d753b 100644
> > --- a/kernel/time/posix-cpu-timers.c
> > +++ b/kernel/time/posix-cpu-timers.c
> > @@ -848,7 +848,7 @@ static void check_thread_timers(struct task_struct *tsk,
> > tsk_expires->virt_exp = expires_to_cputime(expires);
> >
> > tsk_expires->sched_exp = check_timers_list(++timers, firing,
> > - tsk->se.sum_exec_runtime);
> > + read_sum_exec_runtime(tsk));
> >
> > /*
> > * Check for the special case thread timers.
>
> @tsk == current and IRQs are disabled, sum_exec_runtime cannot be
> updated.
>
> > @@ -1115,7 +1115,7 @@ static inline int fastpath_timer_check(struct task_struct *tsk)
> > struct task_cputime task_sample;
> >
> > task_cputime(tsk, &task_sample.utime, &task_sample.stime);
> > - task_sample.sum_exec_runtime = tsk->se.sum_exec_runtime;
> > + task_sample.sum_exec_runtime = read_sum_exec_runtime(tsk);
> > if (task_cputime_expired(&task_sample, &tsk->cputime_expires))
> > return 1;
> > }
>
> Same.
Sorry, I forgot syscalls, those can muck with update_curr() remotely. So
yes, those are needed.
Powered by blists - more mailing lists