All of lore.kernel.org
 help / color / mirror / Atom feed
* Usage of sysV semaphores
@ 2009-10-10  9:16 Bastian Blank
  2009-10-10 19:42 ` Peter Rajnoha
  0 siblings, 1 reply; 2+ messages in thread
From: Bastian Blank @ 2009-10-10  9:16 UTC (permalink / raw)
  To: lvm-devel

Hi

Yesterday I tried to understand the udev sync code and played with it.
I'm not impressed as it broke rather spectacular.

Okay, lets start.

It uses a 32 bit value to synchronize itself. This value needs to make
two things possible: find our own values and distiguish between them.
- Find our own values
  This is done by a 16 bit magic, so a truly random value have a 1/2**16
  probability to reach the dm namespace. This is not good but okay.
- Distiguish between them
  Because of the birthday paradox the probability of conflicting values
  becomes 0.5 with only 2**8 concurent events. Peter spoke about
  hundreds or even thousands of possible flying events, so this is
  relevant and will produce busy looping to find a free one.

SysV semaphore operations are not interruptible. So if something goes
wrong, and according to Murphy it will, the user is left with a process
that can only be killed by SIGKILL and is then not able to clean up
after itself. I'm not sure why, but this was one of the first things
that happened to me during testing.

SysV semaphores are a restricted ressource because they are not cleaned
up upon process exit. So random devmapper usage can just fail with a
message about a, from the user view, completely unrelated ressource.

This problems are bad from the user perspective, because he gets
non-responding or even unkillable processed. If he was able to kill
them, they will leave global ressources behind.

Bastian

-- 
Killing is wrong.
		-- Losira, "That Which Survives", stardate unknown



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

end of thread, other threads:[~2009-10-10 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-10  9:16 Usage of sysV semaphores Bastian Blank
2009-10-10 19:42 ` Peter Rajnoha

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.