btrfs: compress: put variables defined per compress type in struct to make cache...
authorByongho Lee <bhlee.kernel@gmail.com>
Wed, 14 Oct 2015 05:05:24 +0000 (14:05 +0900)
committerDavid Sterba <dsterba@suse.com>
Wed, 21 Oct 2015 16:28:48 +0000 (18:28 +0200)
commitd91876496bcf2236efb75ef12378c964bbe8c970
tree19c5725c87122fdd7f2fde484282c829e0d7f779
parent619ed39242d901339c09faa1b52dad47b0476f6f
btrfs: compress: put variables defined per compress type in struct to make cache friendly

Below variables are defined per compress type.
 - struct list_head comp_idle_workspace[BTRFS_COMPRESS_TYPES]
 - spinlock_t comp_workspace_lock[BTRFS_COMPRESS_TYPES]
 - int comp_num_workspace[BTRFS_COMPRESS_TYPES]
 - atomic_t comp_alloc_workspace[BTRFS_COMPRESS_TYPES]
 - wait_queue_head_t comp_workspace_wait[BTRFS_COMPRESS_TYPES]

BTW, while accessing one compress type of these variables, the next or
before address is other compress types of it.
So this patch puts these variables in a struct to make cache friendly.

Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Byongho Lee <bhlee.kernel@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c