diff options
author | Chunwei Chen <[email protected]> | 2015-12-17 18:31:58 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-12-18 13:24:52 -0800 |
commit | b4ad50ac5f16de9220452f0da493e67c060d701b (patch) | |
tree | 2242714bb50ea85f87792f859d20bbfefcbc9f7c /module/spl/spl-vmem.c | |
parent | 200366f23f1a16874d78a07936c5a33f2d488022 (diff) |
Use spl_fstrans_mark instead of memalloc_noio_save
For earlier versions of the kernel with memalloc_noio_save, it only turns
off __GFP_IO but leaves __GFP_FS untouched during direct reclaim. This
would cause threads to direct reclaim into ZFS and cause deadlock.
Instead, we should stick to using spl_fstrans_mark. Since we would
explicitly turn off both __GFP_IO and __GFP_FS before allocation, it
will work on every version of the kernel.
This impacts kernel versions 3.9-3.17, see upstream kernel commit
torvalds/linux@934f307 for reference.
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tim Chase <[email protected]>
Closes #515
Issue zfsonlinux/zfs#4111
Diffstat (limited to 'module/spl/spl-vmem.c')
-rw-r--r-- | module/spl/spl-vmem.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/module/spl/spl-vmem.c b/module/spl/spl-vmem.c index bca27f263..e177988a7 100644 --- a/module/spl/spl-vmem.c +++ b/module/spl/spl-vmem.c @@ -97,31 +97,6 @@ spl_vmem_free(const void *buf, size_t size) } EXPORT_SYMBOL(spl_vmem_free); -/* - * Public vmalloc() interface designed to be safe to be called during I/O. - */ -void * -spl_vmalloc(unsigned long size, gfp_t lflags, pgprot_t prot) -{ -#if defined(PF_MEMALLOC_NOIO) - void *ptr; - unsigned noio_flag = 0; - - if (spl_fstrans_check()) - noio_flag = memalloc_noio_save(); - - ptr = __vmalloc(size, lflags, prot); - - if (spl_fstrans_check()) - memalloc_noio_restore(noio_flag); - - return (ptr); -#else - return (__vmalloc(size, lflags, prot)); -#endif -} -EXPORT_SYMBOL(spl_vmalloc); - int spl_vmem_init(void) { |