Skip to content

Commit

Permalink
block: re-organize fields of 'struct hd_part'
Browse files Browse the repository at this point in the history
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 <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Cc: Yufen Yu <yuyufen@huawei.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hou Tao <houtao1@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Ming Lei authored and Jens Axboe committed May 13, 2020
1 parent 07c4e1e commit 520138c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ struct hd_struct {
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
seqcount_t nr_sects_seq;
#endif
unsigned long stamp;
#ifdef CONFIG_SMP
struct disk_stats __percpu *dkstats;
#else
struct disk_stats dkstats;
#endif
struct percpu_ref ref;

sector_t alignment_offset;
unsigned int discard_alignment;
struct device __dev;
Expand All @@ -80,13 +88,6 @@ struct hd_struct {
#ifdef CONFIG_FAIL_MAKE_REQUEST
int make_it_fail;
#endif
unsigned long stamp;
#ifdef CONFIG_SMP
struct disk_stats __percpu *dkstats;
#else
struct disk_stats dkstats;
#endif
struct percpu_ref ref;
struct rcu_work rcu_work;
};

Expand Down

0 comments on commit 520138c

Please sign in to comment.