diff options
author | Brian Behlendorf <[email protected]> | 2014-07-13 14:35:19 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-01-16 14:28:05 -0800 |
commit | 92119cc259ee2f9ebde14145f549d6313f557759 (patch) | |
tree | f401b89e39084c21c15049d26951a1e99d4aebef /module/zfs/zpl_file.c | |
parent | d958324f97f4668a2a6e4a6ce3e5ca09b71b31d9 (diff) |
Mark IO pipeline with PF_FSTRANS
In order to avoid deadlocking in the IO pipeline it is critical that
pageout be avoided during direct memory reclaim. This ensures that
the pipeline threads can always make forward progress and never end
up blocking on a DMU transaction. For this very reason Linux now
provides the PF_FSTRANS flag which may be set in the process context.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/zpl_file.c')
-rw-r--r-- | module/zfs/zpl_file.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c index cabe9bf15..61005dcd4 100644 --- a/module/zfs/zpl_file.c +++ b/module/zfs/zpl_file.c @@ -481,19 +481,14 @@ int zpl_putpage(struct page *pp, struct writeback_control *wbc, void *data) { struct address_space *mapping = data; + fstrans_cookie_t cookie; ASSERT(PageLocked(pp)); ASSERT(!PageWriteback(pp)); - ASSERT(!(current->flags & PF_NOFS)); - /* - * Annotate this call path with a flag that indicates that it is - * unsafe to use KM_SLEEP during memory allocations due to the - * potential for a deadlock. KM_PUSHPAGE should be used instead. - */ - current->flags |= PF_NOFS; + cookie = spl_fstrans_mark(); (void) zfs_putpage(mapping->host, pp, wbc); - current->flags &= ~PF_NOFS; + spl_fstrans_unmark(cookie); return (0); } |