]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
btrfs: use kvzalloc to allocate btrfs_fs_info
authorJeff Mahoney <jeffm@suse.com>
Fri, 16 Feb 2018 03:59:47 +0000 (22:59 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commit56bb22e352ff18c73192b72bd536a5688253889a
tree58d81661a2feb57d40ca29aaa0b81814e6e63c06
parent438e25a575296d15a5cde7189fb8364dd3660bca
btrfs: use kvzalloc to allocate btrfs_fs_info

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit a8fd1f71749387c9a1053a83ff1c16287499a4e7 ]

The srcu_struct in btrfs_fs_info scales in size with NR_CPUS.  On
kernels built with NR_CPUS=8192, this can result in kmalloc failures
that prevent mounting.

There is work in progress to try to resolve this for every user of
srcu_struct but using kvzalloc will work around the failures until
that is complete.

As an example with NR_CPUS=512 on x86_64: the overall size of
subvol_srcu is 3460 bytes, fs_info is 6496.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/btrfs/ctree.h
fs/btrfs/super.c