linux-smp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Implementing priority inheritance with user-space wait queues
@ 2017-03-17 15:29 Steven Stewart-Gallus
  0 siblings, 0 replies; only message in thread
From: Steven Stewart-Gallus @ 2017-03-17 15:29 UTC (permalink / raw)
  To: linux-smp

Hello,

I have been recently working on a library that implements futex
wait-queues in user-space (see
https://sstewartgallus.com/git?p=uevents.git;a=summary .)  The basic
idea is that an event semaphore is implemented by a queue of "notifiers"
that waiters and signallers enqueue and dequeue to and from.  Each
notifier could be implemented in a multitude of ways such as eventfds,
pipes, spinning on a memory location or futexes.  However, while I found
my implementation has several possible performance advantages I also
found that it has trouble properly implementing thread priorities when
used to implement locks.  One could easily extend my implementation by
making each event semaphore have 40 queues (one for each priority) but
properly implementing priority inheritance seems to be difficult.
Because each waiter waits on a separate notifier it seems to me that to
properly implement priority inheritance with futexes I'd have to iterate
over all notifiers on the queue and set their wait location to the PID
of the thread that has currently acquired the lock.  Anyway, I thought it
was an interesting problem dealing with low-level futex stuff that
linux-smp might be interested in.

Thank you,
Steven Stewart-Gallus


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-17 15:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-17 15:29 Implementing priority inheritance with user-space wait queues Steven Stewart-Gallus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).