mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-30 10:44:09 +03:00
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 <david.chen@osnexus.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tim Chase <tim@chase2k.com> Closes #515 Issue zfsonlinux/zfs#4111
This commit is contained in:
committed by
Brian Behlendorf
parent
200366f23f
commit
b4ad50ac5f
@@ -185,7 +185,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
|
||||
*/
|
||||
if ((size > spl_kmem_alloc_max) || use_vmem) {
|
||||
if (flags & KM_VMEM) {
|
||||
ptr = spl_vmalloc(size, lflags, PAGE_KERNEL);
|
||||
ptr = __vmalloc(size, lflags, PAGE_KERNEL);
|
||||
} else {
|
||||
return (NULL);
|
||||
}
|
||||
@@ -198,7 +198,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
|
||||
|
||||
/*
|
||||
* For vmem_alloc() and vmem_zalloc() callers retry immediately
|
||||
* using spl_vmalloc() which is unlikely to fail.
|
||||
* using __vmalloc() which is unlikely to fail.
|
||||
*/
|
||||
if ((flags & KM_VMEM) && (use_vmem == 0)) {
|
||||
use_vmem = 1;
|
||||
|
||||
Reference in New Issue
Block a user