lkml.org 
[lkml]   [2009]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:timers/core] clocksource: Resolve cpu hotplug dead lock with TSC unstable
On Fri, 28 Aug 2009 18:34:00 GMT
tip-bot for Thomas Gleixner <tglx@linutronix.de> wrote:

> Commit-ID: 7285dd7fd375763bfb8ab1ac9cf3f1206f503c16
> Gitweb: http://git.kernel.org/tip/7285dd7fd375763bfb8ab1ac9cf3f1206f503c16
> Author: Thomas Gleixner <tglx@linutronix.de>
> AuthorDate: Fri, 28 Aug 2009 20:25:24 +0200
> Committer: Thomas Gleixner <tglx@linutronix.de>
> CommitDate: Fri, 28 Aug 2009 20:25:24 +0200
>
> clocksource: Resolve cpu hotplug dead lock with TSC unstable
>
> Martin Schwidefsky analyzed it:
> To register a clocksource the clocksource_mutex is acquired and if
> necessary timekeeping_notify is called to install the clocksource as
> the timekeeper clock. timekeeping_notify uses stop_machine which needs
> to take cpu_add_remove_lock mutex.
> Starting a new cpu is done with the cpu_add_remove_lock mutex held.
> native_cpu_up checks the tsc of the new cpu and if the tsc is no good
> clocksource_change_rating is called. Which needs the clocksource_mutex
> and the deadlock is complete.
>
> The solution is to replace the TSC via the clocksource watchdog
> mechanism. Mark the TSC as unstable and schedule the watchdog work so
> it gets removed in the watchdog thread context.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> LKML-Reference: <new-submission>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: John Stultz <johnstul@us.ibm.com>

Ah, very good. I've been going round in circles to find a solution that
allows to downgrade the tsc rating when the second cpu is enabled.
Could not find a solution. Your approach changes semantics slightly:
the tsc clock will continue with its old rating for a while until the
watchdog will do the downgrade. If that is acceptable then this is a
good solution.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.



\
 
 \ /
  Last update: 2009-08-31 16:33    [W:0.045 / U:12.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site