mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 17:59:32 +00:00
Btrfs: balance delayed inode updates
While trying to reproduce a delayed ref problem I noticed the box kept falling over using all 80gb of my ram with btrfs_inode's and btrfs_delayed_node's. Turns out this is because we only throttle delayed inode updates in btrfs_dirty_inode, which doesn't actually get called that often, especially when all you are doing is creating a bunch of files. So balance delayed inode updates everytime we create a new inode. With this patch we no longer use up all of our ram with delayed inode updates. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com>
This commit is contained in:
parent
1bae30982b
commit
c581afc8db
1 changed files with 4 additions and 0 deletions
|
@ -5795,6 +5795,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
|
|||
}
|
||||
out_unlock:
|
||||
btrfs_end_transaction(trans, root);
|
||||
btrfs_balance_delayed_items(root);
|
||||
btrfs_btree_balance_dirty(root);
|
||||
if (drop_inode) {
|
||||
inode_dec_link_count(inode);
|
||||
|
@ -5868,6 +5869,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
|
|||
inode_dec_link_count(inode);
|
||||
iput(inode);
|
||||
}
|
||||
btrfs_balance_delayed_items(root);
|
||||
btrfs_btree_balance_dirty(root);
|
||||
return err;
|
||||
}
|
||||
|
@ -5926,6 +5928,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir,
|
|||
}
|
||||
|
||||
btrfs_end_transaction(trans, root);
|
||||
btrfs_balance_delayed_items(root);
|
||||
fail:
|
||||
if (drop_inode) {
|
||||
inode_dec_link_count(inode);
|
||||
|
@ -5992,6 +5995,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
|||
btrfs_end_transaction(trans, root);
|
||||
if (drop_on_err)
|
||||
iput(inode);
|
||||
btrfs_balance_delayed_items(root);
|
||||
btrfs_btree_balance_dirty(root);
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue