mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
btrfs: remove the free space cache endio workqueue
Free space inodes are no longer written to, so nothing queues ordered extent completion on endio_freespace_worker. Remove it and always use endio_write_workers in btrfs_queue_ordered_fn(). Assisted-by: LLM Signed-off-by: Tal Zussman <tz2294@columbia.edu> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
6cc6b6ebea
commit
74c8f34811
|
|
@ -1780,7 +1780,6 @@ static void btrfs_stop_all_workers(struct btrfs_fs_info *fs_info)
|
|||
if (fs_info->rmw_workers)
|
||||
destroy_workqueue(fs_info->rmw_workers);
|
||||
btrfs_destroy_workqueue(fs_info->endio_write_workers);
|
||||
btrfs_destroy_workqueue(fs_info->endio_freespace_worker);
|
||||
btrfs_destroy_workqueue(fs_info->delayed_workers);
|
||||
btrfs_destroy_workqueue(fs_info->caching_workers);
|
||||
btrfs_destroy_workqueue(fs_info->flush_workers);
|
||||
|
|
@ -1991,9 +1990,6 @@ static int btrfs_init_workqueues(struct btrfs_fs_info *fs_info)
|
|||
fs_info->endio_write_workers =
|
||||
btrfs_alloc_workqueue(fs_info, "endio-write", flags,
|
||||
max_active, 2);
|
||||
fs_info->endio_freespace_worker =
|
||||
btrfs_alloc_workqueue(fs_info, "freespace-write", flags,
|
||||
max_active, 0);
|
||||
fs_info->delayed_workers =
|
||||
btrfs_alloc_workqueue(fs_info, "delayed-meta", flags,
|
||||
max_active, 0);
|
||||
|
|
@ -2006,8 +2002,7 @@ static int btrfs_init_workqueues(struct btrfs_fs_info *fs_info)
|
|||
if (!(fs_info->workers &&
|
||||
fs_info->delalloc_workers && fs_info->flush_workers &&
|
||||
fs_info->endio_workers && fs_info->endio_meta_workers &&
|
||||
fs_info->endio_write_workers &&
|
||||
fs_info->endio_freespace_worker && fs_info->rmw_workers &&
|
||||
fs_info->endio_write_workers && fs_info->rmw_workers &&
|
||||
fs_info->caching_workers && fs_info->fixup_workers &&
|
||||
fs_info->delayed_workers && fs_info->qgroup_rescan_workers &&
|
||||
fs_info->discard_ctl.discard_workers)) {
|
||||
|
|
@ -4441,9 +4436,8 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info)
|
|||
* to finish an ordered extent - end_bbio_compressed_write()
|
||||
* calls btrfs_finish_ordered_extent() which in turns does a call to
|
||||
* btrfs_queue_ordered_fn(), and that queues the ordered extent
|
||||
* completion either in the endio_write_workers work queue or in the
|
||||
* fs_info->endio_freespace_worker work queue. We flush those queues
|
||||
* below, so before we flush them we must flush this queue for the
|
||||
* completion in the endio_write_workers work queue. We flush that
|
||||
* queue below, so before we flush it we must flush this queue for the
|
||||
* workers of compressed writes.
|
||||
*/
|
||||
flush_workqueue(fs_info->endio_workers);
|
||||
|
|
@ -4469,8 +4463,6 @@ void __cold close_ctree(struct btrfs_fs_info *fs_info)
|
|||
* btrfs_finish_ordered_io() when we are unmounting).
|
||||
*/
|
||||
btrfs_flush_workqueue(fs_info->endio_write_workers);
|
||||
/* Ordered extents for free space inodes. */
|
||||
btrfs_flush_workqueue(fs_info->endio_freespace_worker);
|
||||
/*
|
||||
* Run delayed iputs in case an async reclaim worker is waiting for them
|
||||
* to be run as mentioned above.
|
||||
|
|
|
|||
|
|
@ -712,7 +712,6 @@ struct btrfs_fs_info {
|
|||
struct workqueue_struct *endio_meta_workers;
|
||||
struct workqueue_struct *rmw_workers;
|
||||
struct btrfs_workqueue *endio_write_workers;
|
||||
struct btrfs_workqueue *endio_freespace_worker;
|
||||
struct btrfs_workqueue *caching_workers;
|
||||
|
||||
struct workqueue_struct *fixup_workers;
|
||||
|
|
|
|||
|
|
@ -417,13 +417,10 @@ static bool can_finish_ordered_extent(struct btrfs_ordered_extent *ordered,
|
|||
|
||||
static void btrfs_queue_ordered_fn(struct btrfs_ordered_extent *ordered)
|
||||
{
|
||||
struct btrfs_inode *inode = ordered->inode;
|
||||
struct btrfs_fs_info *fs_info = inode->root->fs_info;
|
||||
struct btrfs_workqueue *wq = btrfs_is_free_space_inode(inode) ?
|
||||
fs_info->endio_freespace_worker : fs_info->endio_write_workers;
|
||||
struct btrfs_fs_info *fs_info = ordered->inode->root->fs_info;
|
||||
|
||||
btrfs_init_work(&ordered->work, finish_ordered_fn, NULL);
|
||||
btrfs_queue_work(wq, &ordered->work);
|
||||
btrfs_queue_work(fs_info->endio_write_workers, &ordered->work);
|
||||
}
|
||||
|
||||
void btrfs_finish_ordered_extent(struct btrfs_ordered_extent *ordered,
|
||||
|
|
|
|||
|
|
@ -1264,7 +1264,6 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
|
|||
workqueue_set_max_active(fs_info->endio_workers, new_pool_size);
|
||||
workqueue_set_max_active(fs_info->endio_meta_workers, new_pool_size);
|
||||
btrfs_workqueue_set_max(fs_info->endio_write_workers, new_pool_size);
|
||||
btrfs_workqueue_set_max(fs_info->endio_freespace_worker, new_pool_size);
|
||||
btrfs_workqueue_set_max(fs_info->delayed_workers, new_pool_size);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user