From: Sergey Senozhatsky Date: Tue, 24 Jun 2014 15:00:44 +0000 (+0900) Subject: btrfs compression: reuse recently used workspace X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c39aa7056f50fa7b49265ea35c0f3eddb7c7be68;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Reviewed-by: David Sterba Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 92371c414228..1daea0b47187 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -821,7 +821,7 @@ static void free_workspace(int type, struct list_head *workspace) spin_lock(workspace_lock); if (*num_workspace < num_online_cpus()) { - list_add_tail(workspace, idle_workspace); + list_add(workspace, idle_workspace); (*num_workspace)++; spin_unlock(workspace_lock); goto wake;