diff mbox

btrfs compression: reuse recently used workspace

Message ID 1403622044-2964-2-git-send-email-sergey.senozhatsky@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Sergey Senozhatsky June 24, 2014, 3 p.m. UTC
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>
---
 fs/btrfs/compression.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Sterba June 26, 2014, 5:02 p.m. UTC | #1
On Wed, Jun 25, 2014 at 12:00:44AM +0900, Sergey Senozhatsky wrote:
> 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>

Makes sense to me,
Reviewed-by: David Sterba <dsterba@suse.cz>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 92371c4..1daea0b 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;