HomeFreeBSD

Fix txg_quiesce thread deadlock

Description

Fix txg_quiesce thread deadlock

A deadlock was accidentally introduced by commit e95853a which
can occur when the system is under memory pressure. What happens
is that while the txg_quiesce thread is holding the tx->tx_cpu
locks it enters memory reclaim. In the context of this memory
reclaim it then issues synchronous I/O to a ZVOL swap device.
Because the txg_quiesce thread is holding the tx->tx_cpu locks
a new txg cannot be opened to handle the I/O. Deadlock.

The fix is straight forward. Move the memory allocation outside
the critical region where the tx->tx_cpu locks are held. And for
good measure change the offending allocation to KM_PUSHPAGE to
ensure it never attempts to issue I/O during reclaim.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #1274

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Apr 25 2013, 11:29 PM
Parents
rG0c15bf16f105: Ignore *.{deb,rpm,tar.gz} files in the top directory.
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG57f5a2008e2e: Fix txg_quiesce thread deadlock (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Apr 26 2013, 9:42 PM