lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 13 Sep 2011 15:07:03 +0100
From:	David Howells <dhowells@...hat.com>
To:	Vladislav Bolkhovitin <vst@...b.net>
Cc:	dhowells@...hat.com, Al Viro <viro@...IV.linux.org.uk>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: Lockdep and rw_semaphores


Al is correct.

The in-kernel R/W semaphore implementation is written to be strictly fair.  If
the semaphore is readlocked and a writer is pending, all further readers and
writers get added to the back of the FIFO queue, thus preventing writers from
being starved.

When it comes time to wake someone up, the waiter at the front of the queue is
woken. If that's a reader, then next on the queue may be woken up too if
that's also a reader - up to the point a writer is encountered.  Any readers
beyond that writer in the queue have to wait for the writer in front of them
to get its share first.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ