Message ID | npds64$nu3$1@blaine.gmane.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Le 21/08/2016 à 17:39, Jean-Denis Girard a écrit : > Hi list, > > After upgrading my Fedora 23 system from 4.4.12 to 4.7.2, I'm seeing one > btrfs-cleaner process stuck at 100% CPU. The problem disappears when > going back to 4.4 kernel (4.4.17), but is also present with Fedora > kernel 4.6.6-200.fc23. Just for the archives, I found that the problem was related to fragmentation. Mounting without autodefrag on 4.7.2 avoided btrfs-cleaner stuck at 100 % CPU. Then I did manually defragment all Btrfs volumes, and could then remount with autodefrag. Every thing is ok after ~12 hours uptime. Thanks,
diff -Naur linux-4.4.6.ORIG/fs/btrfs/ctree.c linux-4.4.6/fs/btrfs/ctree.c --- linux-4.4.6.ORIG/fs/btrfs/ctree.c 2016-01-10 13:01:32.000000000 -1000 +++ linux-4.4.6/fs/btrfs/ctree.c 2016-03-30 06:19:16.397973820 -1000 @@ -20,6 +20,7 @@ #include <linux/slab.h> #include <linux/rbtree.h> #include "ctree.h" +#include <linux/vmalloc.h> #include "disk-io.h" #include "transaction.h" #include "print-tree.h" @@ -5362,10 +5363,13 @@ goto out; } - tmp_buf = kmalloc(left_root->nodesize, GFP_NOFS); + tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL | __GFP_NOWARN); if (!tmp_buf) { - ret = -ENOMEM; - goto out; + tmp_buf = vmalloc(left_root->nodesize); + if (!tmp_buf) { + ret = -ENOMEM; + goto out; + } } left_path->search_commit_root = 1; @@ -5566,7 +5570,7 @@ out: btrfs_free_path(left_path); btrfs_free_path(right_path); - kfree(tmp_buf); + kvfree(tmp_buf); return ret; }