From: john.stultz@linaro.org (John Stultz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] sched_clock: Prevent callers from seeing half-updated data
Date: Mon, 17 Feb 2014 10:04:32 -0800 [thread overview]
Message-ID: <53024F30.6010108@linaro.org> (raw)
In-Reply-To: <20140217111910.GE26312@mudshark.cambridge.arm.com>
On 02/17/2014 03:19 AM, Will Deacon wrote:
> On Mon, Feb 10, 2014 at 11:14:35AM +0000, Will Deacon wrote:
>> On Fri, Feb 07, 2014 at 10:28:58PM +0000, Stephen Boyd wrote:
>>> If two sched_clock sources are registered we may end up in a
>>> situation where a call to sched_clock() may be accessing the
>>> epoch cycle count for the old counter and the cycle count for the
>>> new counter. This can lead to confusing results where
>>> sched_clock() values jump and then are reset to 0 (due to the way
>>> the registration function forces the epoch_ns to be 0). Fix this
>>> by reorganizing the registration function to hold the seqlock for
>>> as short a time as possible while we update the clock_data
>>> structure for a new counter. We also put any accumulated time
>>> into epoch_ns instead of resetting the time to 0 so that the clock
>>> doesn't reset after each successful registration.
>>>
>>> Reported-by: Will Deacon <will.deacon@arm.com>
>>> Cc: Josh Cartwright <joshc@codeaurora.org>
>>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>>> ---
>>>
>>> Changes since v1:
>>> * Put elapsed time into epoch_ns
>> Well, this certainly fixes the dmesg prints and the system seems ok once
>> it's booted:
>>
>> Tested-by: Will Deacon <will.deacon@arm.com>
> Any chance of getting this merged please? I still see the weird timing
> numbers when booting -rc3.
My apologies! I somehow missed your tested-by mail.
I'll queue it up and send it in.
thanks
-john
prev parent reply other threads:[~2014-02-17 18:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 18:36 Weird sched_clock behaviour during boot with -rc1 Will Deacon
2014-02-04 20:46 ` John Stultz
2014-02-04 22:00 ` Stephen Boyd
2014-02-05 21:47 ` Josh Cartwright
2014-02-07 18:23 ` John Stultz
2014-02-07 19:37 ` Stephen Boyd
2014-02-07 20:48 ` [PATCH] sched_clock: Prevent callers from seeing half-updated data Stephen Boyd
2014-02-07 22:22 ` Stephen Boyd
2014-02-07 22:28 ` John Stultz
2014-02-11 6:49 ` Stephen Boyd
2014-02-17 18:13 ` John Stultz
2014-02-07 22:28 ` [PATCH v2] " Stephen Boyd
2014-02-10 11:14 ` Will Deacon
2014-02-17 11:19 ` Will Deacon
2014-02-17 18:04 ` John Stultz [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=53024F30.6010108@linaro.org \
--to=john.stultz@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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.