From: Jason Low <jason.low2@hp.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Galbraith <umgwanakikbuti@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Rik van Riel <riel@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Scott Norton <scott.norton@hp.com>,
Aswin Chandramouleeswaran <aswin@hp.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
jason.low2@hp.com
Subject: Re: [PATCH v2] sched, timer: Use atomics for thread_group_cputimer to improve scalability
Date: Mon, 02 Mar 2015 14:43:20 -0800 [thread overview]
Message-ID: <1425336200.5304.84.camel@j-VirtualBox> (raw)
In-Reply-To: <CA+55aFy3Kvyhtr92FCLTcBGLmibP+BgM57zJkPMgL-JfLrZn2A@mail.gmail.com>
On Mon, 2015-03-02 at 13:44 -0800, Linus Torvalds wrote:
> On Mon, Mar 2, 2015 at 1:16 PM, Jason Low <jason.low2@hp.com> wrote:
> >
> > In original code, we set cputimer->running first so it is running while
> > we call update_gt_cputime(). Now in this patch, we swapped the 2 calls
> > such that we set running after calling update_gt_cputime(), so that
> > wouldn't be an issue anymore.
>
> Hmm. If you actually care about ordering, and 'running' should be
> written to after the other things, then it might be best if you use
>
> smp_store_release(&cputimer->running, 1);
>
> which makes it clear that the store happens *after* what went before it.
>
> Or at least have a "smp_wmb()" between the atomic64 updates and the
> "WRITE_ONCE()".
>
> I guess that since you use cmpxchg in update_gt_cputime, the accesses
> end up being ordered anyway, but it might be better to make that thing
> very explicit.
Yeah, I suppose the extra (smp_mb or smp_wmb) might add more overhead
but since this is not a common code path anyway, it would be worth
adding it to make things more clear.
next prev parent reply other threads:[~2015-03-02 22:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 18:42 [PATCH v2] sched, timer: Use atomics for thread_group_cputimer to improve scalability Jason Low
2015-03-02 19:03 ` Linus Torvalds
2015-03-02 21:49 ` Jason Low
2015-03-19 17:21 ` Jason Low
2015-03-19 17:59 ` Linus Torvalds
2015-03-19 20:14 ` Jason Low
2015-03-02 19:40 ` Oleg Nesterov
2015-03-02 19:43 ` Oleg Nesterov
2015-03-02 21:16 ` Jason Low
2015-03-02 21:44 ` Linus Torvalds
2015-03-02 22:43 ` Jason Low [this message]
2015-03-05 15:20 ` Frederic Weisbecker
2015-03-05 20:02 ` Jason Low
2015-03-02 21:19 ` Jason Low
2015-03-05 15:35 ` Frederic Weisbecker
2015-03-05 15:56 ` Paul E. McKenney
2015-03-05 16:00 ` Frederic Weisbecker
2015-03-05 16:16 ` Paul E. McKenney
2015-03-06 0:06 ` Jason Low
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=1425336200.5304.84.camel@j-VirtualBox \
--to=jason.low2@hp.com \
--cc=akpm@linux-foundation.org \
--cc=aswin@hp.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=rostedt@goodmis.org \
--cc=scott.norton@hp.com \
--cc=torvalds@linux-foundation.org \
--cc=umgwanakikbuti@gmail.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.