Skip to contentSkip to conversation

Btrfs: remove unused wait queue in struct extent_buffer

PATCH In review Filipe David Borba Manana 2 participants 2 messages Jun 16, 2014 – Jun 17, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: remove unused wait queue in struct extent_buffer

The lock_wq wait queue is not used anywhere, therefore just remove it. On a x86_64 system, this reduced sizeof(struct extent_buffer) from 320 bytes down to 296 bytes, which means a 4Kb page can now be used for 13 extent buffers instead of 12.

---
 fs/btrfs/extent_io.h | 1 -
 1 file changed, 1 deletion(-)
fs/btrfs/extent_io.h +0 -1
index 8b63f2d..dbbea4f 100644
@@ -158,7 +158,6 @@ struct extent_buffer {
 	 * to unlock
 	 */
 	wait_queue_head_t read_lock_wq;
-	wait_queue_head_t lock_wq;
 	struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
 #ifdef CONFIG_BTRFS_DEBUG
 	struct list_head leak_list;
Signature · 1 line
1.9.1
#1 lore raw

Hi Filipe,

Quoted 6 lines · Filipe David Borba Manana

The lock_wq wait queue is not used anywhere, therefore just remove it. On a x86_64 system, this reduced sizeof(struct extent_buffer) from 320 bytes down to 296 bytes, which means a 4Kb page can now be used for 13 extent buffers instead of 12.

It looks good to me. This field was once removed by bd681513. However, re-introduced in error by 727011e07c
(both are Chris's patch).

I consider it's better to fix the following comment too.

===

$ cat -n fs/btrfs/extent_io.h | grep -B 3 write_lock_wq
   152          /* readers use lock_wq while they wait for the write
   153           * lock holders to unlock
   154           */
   155          wait_queue_head_t write_lock_wq;
===

We should "s/ lock_wq / write_lock_wq /" here.

Thanks,
Satoru

Quoted 17 lines
---
  fs/btrfs/extent_io.h | 1 -
  1 file changed, 1 deletion(-)
fs/btrfs/extent_io.h +0 -1
index 8b63f2d..dbbea4f 100644
@@ -158,7 +158,6 @@ struct extent_buffer {
  	 * to unlock
  	 */
  	wait_queue_head_t read_lock_wq;
-	wait_queue_head_t lock_wq;
  	struct page *pages[INLINE_EXTENT_BUFFER_PAGES];
  #ifdef CONFIG_BTRFS_DEBUG
  	struct list_head leak_list;