All of lore.kernel.org
 help / color / mirror / Atom feed
* Cobalt Preemption of kernel update_fast_timekeeper can cause deadlocks
@ 2018-12-19 10:20 Lange Norbert
  2018-12-19 12:09 ` Philippe Gerum
  0 siblings, 1 reply; 12+ messages in thread
From: Lange Norbert @ 2018-12-19 10:20 UTC (permalink / raw)
  To: Xenomai (xenomai@xenomai.org)

There is a deadlock issue that haunted me for several weeks,
it is caused by the kernels update of the user-visible
timekeeping structures used by the VDSO clock_gettime functions.

The kernel regularly updates a Timestamp structure, which is accessible in user-mode,
it does so by something akin to a rw-lock in update_fast_timekeeper.

If cobalt preempts the core during holding the lock, any thread trying to read the time
will continue to spin. (This alone is an issue IMHO).
If the cobalt thread itself now call the vDSO function as reader,
it will spin on the lock and block the lock from getting released.


Either the update_fast_timekeeper funtion should not be preemptible by cobalt,
or the spin-lock on reading could fallback to the syscall after a certain amount of retries.

The later is probably easier to implement, but then could randomly demote cobalt threads.
(on the other hand, this would be always a demotion on platforms without the vdso function)

Mit besten Grüßen / Kind regards

NORBERT LANGE
AT-DES

ANDRITZ HYDRO GmbH
Eibesbrunnergasse 20
1120 Vienna / AUSTRIA
p: +43 50805 56684
norbert.lange@andritz.com
andritz.com
________________________________

This message and any attachments are solely for the use of the intended recipients. They may contain privileged and/or confidential information or other information protected from disclosure. If you are not an intended recipient, you are hereby notified that you received this email in error and that any review, dissemination, distribution or copying of this email and any attachment is strictly prohibited. If you have received this email in error, please contact the sender and delete the message and any attachment from your system.

ANDRITZ HYDRO GmbH


Rechtsform/ Legal form: Gesellschaft mit beschränkter Haftung / Corporation

Firmensitz/ Registered seat: Wien

Firmenbuchgericht/ Court of registry: Handelsgericht Wien

Firmenbuchnummer/ Company registration: FN 61833 g

DVR: 0605077

UID-Nr.: ATU14756806


Thank You
________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-12-21 13:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-19 10:20 Cobalt Preemption of kernel update_fast_timekeeper can cause deadlocks Lange Norbert
2018-12-19 12:09 ` Philippe Gerum
2018-12-19 12:44   ` Jan Kiszka
2018-12-19 13:08     ` Lange Norbert
2018-12-19 13:47     ` Philippe Gerum
2018-12-19 18:26     ` Auel, Kendall
2018-12-20 10:45       ` Jan Kiszka
2018-12-20 12:29         ` Lange Norbert
2018-12-20 13:32           ` Jan Kiszka
2018-12-20 15:02             ` Lange Norbert
2018-12-20 15:21               ` Jan Kiszka
2018-12-21 13:31                 ` Lange Norbert

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.