Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2004 11:55:28 +0000 (GMT)
From:      Jan Grant <Jan.Grant@bristol.ac.uk>
To:        Piotr Gnyp <toread@discordia.pl>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Lock order reversal
Message-ID:  <Pine.GSO.4.58.0401291150410.26546@mail.ilrt.bris.ac.uk>
In-Reply-To: <Pine.BSF.4.58.0401291222260.647@discordia.pl>
References:  <Pine.BSF.4.58.0401291222260.647@discordia.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 29 Jan 2004, Piotr Gnyp wrote:

> What is exactly lock order reversal? I`ve encountered something like
> this on my console:
> lock order reversal
>  1st 0xc720dce4 vm object (vm object) @ vm/swap_pager.c:1323
>  2nd 0xc06c01a0 swap_pager swhash (swap_pager swhash) @
> vm/swap_pager.c:1838
>  3rd 0xc0c358c4 vm object (vm object) @ vm/uma_core.c:873

A lock is a software object that is attached to a piece of data in order
to prevent multiple concurrent accesses/updates to that data getting an
inconsistent picture of the data.

FreeBSD "names" classes of lock depending on the objects they protect.

There are situations that can arise called "deadlock" where process A
holds lock x and waits for lock y; process B holds lock y and waits for
lock x.

Various schemes for ordering lock acquisition can be used to guarantee
that deadlocks can arise. A "lock order reversal" means that the
debugging watchdog in your kernel has detected that locks of two classes
were acquired in different orders.

-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287088 Fax +44 (0)117 9287112 http://ioctl.org/jan/
If you have received this email in error, do whatever the hell
you want with it. It's not like I can stop you anyway.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.58.0401291150410.26546>