Skip to content

Commit 520138c

Browse files
Ming Leiaxboe
authored andcommitted
block: re-organize fields of 'struct hd_part'
Put all fields accessed in IO path together at the beginning of the struct, so that all can be fetched in single cacheline. Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Cc: Yufen Yu <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Hou Tao <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 07c4e1e commit 520138c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

include/linux/genhd.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ struct hd_struct {
7171
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
7272
seqcount_t nr_sects_seq;
7373
#endif
74+
unsigned long stamp;
75+
#ifdef CONFIG_SMP
76+
struct disk_stats __percpu *dkstats;
77+
#else
78+
struct disk_stats dkstats;
79+
#endif
80+
struct percpu_ref ref;
81+
7482
sector_t alignment_offset;
7583
unsigned int discard_alignment;
7684
struct device __dev;
@@ -80,13 +88,6 @@ struct hd_struct {
8088
#ifdef CONFIG_FAIL_MAKE_REQUEST
8189
int make_it_fail;
8290
#endif
83-
unsigned long stamp;
84-
#ifdef CONFIG_SMP
85-
struct disk_stats __percpu *dkstats;
86-
#else
87-
struct disk_stats dkstats;
88-
#endif
89-
struct percpu_ref ref;
9091
struct rcu_work rcu_work;
9192
};
9293

0 commit comments

Comments
 (0)