Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Annotate tasks which require KM_PUSHPAGE
When the txg_sync thread issues an I/O and blocks in zio_wait(). Then it is critical that all processes involved in handling that I/O use KM_PUSHPAGE when performing allocations. If they use KM_SLEEP then it is possible that during a low memory condition direct reclaim will be invoked and it may attempt to flush dirty data to the file system. This will result in the thread attempting to assign a TX will block until the txg_sync thread completes. The end result is a deadlock with the txg_sync thread blocked on the original I/O, and the taskq thread blocked on the txg_sync thread. To prevent developers from accidentally introducing this type of deadlock. This patch passes the TQ_PUSHPAGE_THREAD flag when dispatching a I/O to a taskq which the txg_sync thread is waiting on. This causes the taskq thread to set the PF_NOFS flag in its task struct while the zio_execute() function is being executed. Thereby ensuring that any accidental misuse of the KM_SLEEP is quickly causes and fixed. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue openzfs#1928
- Loading branch information