Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2014 22:26:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 195262] [lor] Possibly two LORs: entropy harvest mutex and scrlock, and entropy harvest mutex and sleepq chain
Message-ID:  <bug-195262-8-aIqDMnoHqe@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-195262-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-195262-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195262

Xin LI <delphij@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhb@FreeBSD.org,
                   |                            |markm@FreeBSD.org

--- Comment #3 from Xin LI <delphij@FreeBSD.org> ---
I think these are false positives.

harvest_mtx is a spinning mutex that is only acquired in random_harvestq.c, and
it's already done quite carefully.

The problem is raised when calling msleep_spin_sbt(), which in turn tries to
acquire sleepq chain lock (sys/kern/subr_sleepqueue.c).  In witness, the
"blessed" order is sleepq chain and then entropy harvest mutex, this is not
right (the system does not poke with entropy harvesting when manipulating
sleepq chain), so you see the second LOR warning.

When it tries to print the LOR warning, the code eventually calls printf()
which in turn would go to syscons(4) where scrlock is acquired.  The defined
lock order wants scrlock be acquired before harvest_mtx and therefore you would
see the first LOR warning.

Could you please try the attached patch and see if it solves the problem?  What
it does is to move entropy mutex slightly higher, allowing it to be held before
acquiring sleepq chain lock.  This would eliminate the (false) LOR warning and
make the first LOR go away at the same time.

Adding jhb@ and markm@ for review.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-195262-8-aIqDMnoHqe>