mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 18:39:59 +00:00
btrfs: use kvzalloc to allocate btrfs_fs_info
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>
This commit is contained in:
parent
fd649f10c3
commit
a8fd1f7174
2 changed files with 2 additions and 2 deletions
|
@ -2974,7 +2974,7 @@ static inline void free_fs_info(struct btrfs_fs_info *fs_info)
|
||||||
kfree(fs_info->super_copy);
|
kfree(fs_info->super_copy);
|
||||||
kfree(fs_info->super_for_commit);
|
kfree(fs_info->super_for_commit);
|
||||||
security_free_mnt_opts(&fs_info->security_opts);
|
security_free_mnt_opts(&fs_info->security_opts);
|
||||||
kfree(fs_info);
|
kvfree(fs_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tree mod log functions from ctree.c */
|
/* tree mod log functions from ctree.c */
|
||||||
|
|
|
@ -1545,7 +1545,7 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
|
||||||
* it for searching for existing supers, so this lets us do that and
|
* it for searching for existing supers, so this lets us do that and
|
||||||
* then open_ctree will properly initialize everything later.
|
* then open_ctree will properly initialize everything later.
|
||||||
*/
|
*/
|
||||||
fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL);
|
fs_info = kvzalloc(sizeof(struct btrfs_fs_info), GFP_KERNEL);
|
||||||
if (!fs_info) {
|
if (!fs_info) {
|
||||||
error = -ENOMEM;
|
error = -ENOMEM;
|
||||||
goto error_sec_opts;
|
goto error_sec_opts;
|
||||||
|
|
Loading…
Reference in a new issue