Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sergey Senozhatsky and committed by
Chris Mason
c39aa705 5588383e

+1 -1
+1 -1
fs/btrfs/compression.c
··· 821 821 822 822 spin_lock(workspace_lock); 823 823 if (*num_workspace < num_online_cpus()) { 824 - list_add_tail(workspace, idle_workspace); 824 + list_add(workspace, idle_workspace); 825 825 (*num_workspace)++; 826 826 spin_unlock(workspace_lock); 827 827 goto wake;