Skip to content

Commit c39aa70

Browse files
sergey-senozhatskyChris Mason
authored andcommitted
btrfs compression: reuse recently used workspace
Add compression `workspace' in free_workspace() to `idle_workspace' list head, instead of tail. So we have better chances to reuse most recently used `workspace'. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Reviewed-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
1 parent 5588383 commit c39aa70

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/btrfs/compression.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ static void free_workspace(int type, struct list_head *workspace)
821821

822822
spin_lock(workspace_lock);
823823
if (*num_workspace < num_online_cpus()) {
824-
list_add_tail(workspace, idle_workspace);
824+
list_add(workspace, idle_workspace);
825825
(*num_workspace)++;
826826
spin_unlock(workspace_lock);
827827
goto wake;

0 commit comments

Comments
 (0)