Skip to content

Commit

Permalink
Fix ASSERTION(!dsl_pool_sync_context(tx->tx_pool))
Browse files Browse the repository at this point in the history
Disable the normal reclaim path for the txg_sync thread.  This
ensures the thread will never enter dmu_tx_assign() which can
otherwise occur due to direct reclaim.  If this is allowed to
happen the system can deadlock.  Direct reclaim call path:

  ->shrink_icache_memory->prune_icache->dispose_list->
  clear_inode->zpl_clear_inode->zfs_inactive->dmu_tx_assign
  • Loading branch information
behlendorf committed Apr 7, 2011
1 parent 7cb67b4 commit eec8164
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions module/zfs/txg.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,19 @@ txg_sync_thread(dsl_pool_t *dp)
callb_cpr_t cpr;
uint64_t start, delta;

#ifdef _KERNEL
/*
* Disable the normal reclaim path for the txg_sync thread. This
* ensures the thread will never enter dmu_tx_assign() which can
* otherwise occur due to direct reclaim. If this is allowed to
* happen the system can deadlock. Direct reclaim call path:
*
* ->shrink_icache_memory->prune_icache->dispose_list->
* clear_inode->zpl_clear_inode->zfs_inactive->dmu_tx_assign
*/
current->flags |= PF_MEMALLOC;
#endif /* _KERNEL */

txg_thread_enter(tx, &cpr);

start = delta = 0;
Expand Down

0 comments on commit eec8164

Please sign in to comment.