]> git.proxmox.com Git - mirror_spl-debian.git/commit
Add PF_NOFS debugging flag
authorBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 18 Aug 2012 19:42:28 +0000 (12:42 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 27 Aug 2012 19:00:55 +0000 (12:00 -0700)
commiteb0f407a2b9089113ef6f2402ebd887511315b43
treed02e28271e7938fc79dd3db92e8404800579358f
parent500e95c884f711883e094b48b58450ce2d80f2ea
Add PF_NOFS debugging flag

PF_NOFS is a per-process debug flag which is set in current->flags to
detect when a process is performing an unsafe allocation.  All tasks
with PF_NOFS set must strictly use KM_PUSHPAGE for allocations because
if they enter direct reclaim and initiate I/O they may deadlock.

When debugging is disabled, any incorrect usage will be detected and
a call stack with a warning will be printed to the console.  The flags
will then be automatically corrected to allow for safe execution.  If
debugging is enabled this will be treated as a fatal condition.

To avoid any risk of conflicting with the existing PF_ flags.  The
PF_NOFS bit shadows the rarely used PF_MUTEX_TESTER bit.  Only when
CONFIG_RT_MUTEX_TESTER is not set, and we know this bit is unused,
will the PF_NOFS bit be valid.  Happily, most existing distributions
ship a kernel with CONFIG_RT_MUTEX_TESTER disabled.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/kmem.h