sysvshm: replace Giant with a local sx lock

Konstantin Belousov kostikbel at gmail.com
Tue Apr 23 20:55:41 UTC 2013


On Tue, Apr 23, 2013 at 10:38:23PM +0200, Mateusz Guzik wrote:
> Hello,
> 
> I would like to replace Giant with a local sx lock in sysvshm code.
> Looked really straightforward so maybe I missed something.

At very least, the shmget_existing() is no longer functional.
The sx is owned around tsleep(), and thus a progress cannot be made
by other thread, which needs the same sx lock.

Use of the SHMSEG_REMOVED in the shmget_allocate_segment() does
not make any sense in your patch, since sleeping malloc allocation
owns sx and prevent other threads from finding the segment.

I did not looked further.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20130423/ef1d1dcc/attachment.sig>


More information about the freebsd-current mailing list