Skip to content

Commit

Permalink
Revert Fix zpl_writepage() deadlock
Browse files Browse the repository at this point in the history
The commit, cfc9a5c, to fix deadlocks
in zpl_writepage() relied on PF_MEMALLOC.   That had the effect of
disabling the direct reclaim path on all allocations originating from
calls to this function, but it failed to address the actual cause of
those deadlocks.  This led to the same deadlocks being observed with
swap on zvols, but not with swap on the loop device, which exercises
this code.

The use of PF_MEMALLOC also had the side effect of permitting
allocations to be made from ZONE_DMA in instances that did not require
it.  This contributes to the possibility of panics caused by depletion
of pages from ZONE_DMA.

As such, we revert this patch in favor of a proper fix for both issues.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#726
  • Loading branch information
chrisrd committed Jul 31, 2012
1 parent 5fc59a3 commit 7b5e21b
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions module/zfs/zpl_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,20 +358,7 @@ zpl_putpage(struct page *pp, struct writeback_control *wbc, void *data)
ASSERT(PageLocked(pp));
ASSERT(!PageWriteback(pp));

/*
* Disable the normal reclaim path for zpl_putpage(). This
* ensures that all memory allocations under this call path
* will never enter direct reclaim. If this were to happen
* the VM might try to write out additional pages by calling
* zpl_putpage() again resulting in a deadlock.
*/
if (current->flags & PF_MEMALLOC) {
(void) zfs_putpage(mapping->host, pp, wbc);
} else {
current->flags |= PF_MEMALLOC;
(void) zfs_putpage(mapping->host, pp, wbc);
current->flags &= ~PF_MEMALLOC;
}
(void) zfs_putpage(mapping->host, pp, wbc);

return (0);
}
Expand Down

0 comments on commit 7b5e21b

Please sign in to comment.