On 19/03/2021 18:59, Josef Bacik wrote:
>> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
>> index f9250f14fc1e..d4fccf113df1 100644
>> --- a/fs/btrfs/disk-io.c
>> +++ b/fs/btrfs/disk-io.c
>> @@ -1815,6 +1815,13 @@ static int cleaner_kthread(void *arg)
>>               * unused block groups.
>>               */
>>              btrfs_delete_unused_bgs(fs_info);
>> +
>> +            /*
>> +             * Reclaim block groups in the reclaim_bgs list after we deleted
>> +             * all unused block_groups. This possibly gives us some more 
>> free
>> +             * space.
>> +             */
>> +            btrfs_reclaim_bgs(fs_info);
> Reclaim can be a super long process, and we use the cleaner to keep up with 
> other things, like delayed iputs and deleted snapshots.  I'd rather offload 
> this 
> to it's own worker thread so that the cleaner doesn't get bogged down in the 
> relocation work.
> 

As I finally have time to get back to this, kthread or workqueue? What does make
more sense here?

Reply via email to