From: Peter Zijlstra <peterz@infradead.org>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: linux-kernel@vger.kernel.org,
Giovanni Gherdovich <ggherdovich@suse.cz>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mel Gorman <mgorman@techsingularity.net>,
Mike Galbraith <mgalbraith@suse.de>,
Paolo Bonzini <pbonzini@redhat.com>,
Rik van Riel <riel@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Wanpeng Li <wanpeng.li@hotmail.com>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v3] sched/cputime: Protect some other sum_exec_runtime reads on 32 bit cpus
Date: Wed, 7 Sep 2016 08:50:57 +0200 [thread overview]
Message-ID: <20160907065057.GM10168@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160906190129.GO10153@twins.programming.kicks-ass.net>
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.
prev parent reply other threads:[~2016-09-07 6:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 12:49 [PATCH v3] sched/cputime: Protect some other sum_exec_runtime reads on 32 bit cpus Stanislaw Gruszka
2016-09-06 19:01 ` Peter Zijlstra
2016-09-07 6:38 ` Stanislaw Gruszka
2016-09-07 7:01 ` Peter Zijlstra
2016-09-07 6:50 ` Peter Zijlstra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160907065057.GM10168@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ggherdovich@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mgalbraith@suse.de \
--cc=mgorman@techsingularity.net \
--cc=mingo@kernel.org \
--cc=pbonzini@redhat.com \
--cc=riel@redhat.com \
--cc=sgruszka@redhat.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=wanpeng.li@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.