> -----Original Message----- > From: Jens Axboe <axboe@xxxxxxxxx> > Sent: Friday, August 28, 2020 6:52 PM > To: Elliott, Robert (Servers) <elliott@xxxxxxx>; Andreas Herrmann > <aherrmann@xxxxxxxx> > Subject: Re: [PATCH 1/2] thread_options: Add cgroup_use_bfq > ... > > ... > >> @@ -593,11 +594,13 @@ struct thread_options_pack { > >> uint8_t profile[FIO_TOP_STR_MAX]; > >> > >> /* > >> - * blkio cgroup support > >> + * (blk)io cgroup support > >> */ > >> uint8_t cgroup[FIO_TOP_STR_MAX]; > >> uint32_t cgroup_weight; > >> uint32_t cgroup_nodelete; > >> + uint32_t cgroup_use_bfq; > >> + uint32_t padding; /* remove when possible to maintain > alignment */ > >> > >> uint32_t uid; > >> uint32_t gid; > > > > Since the structure already has three pad fields: > > uint32_t pad; > > > > uint64_t size; > > ... > > uint32_t pad2; > > uint64_t rand_seed; > > ... > > uint32_t pad3; > > fio_fp64_t percentile_list[FIO_IO_U_LIST_MAX_LEN]; > > > > pad4 would seem like the natural name for another padding field, > and > > the comment doesn't seem necessary. > > Also worth checking if you can actually remove padding when updating > it, rather than adding more. I do think that one is needed, because there's a floating point variable afterwards that libfio.c insists be aligned to an 8-byte boundary. The pahole utility reports the offsets (pre-patch) are: /* --- cacheline 395 boundary (25280 bytes) was 24 bytes ago --- */ uint8_t cgroup[256]; /* 25304 256 */ /* --- cacheline 399 boundary (25536 bytes) was 24 bytes ago --- */ uint32_t cgroup_weight; /* 25560 4 */ uint32_t cgroup_nodelete; /* 25564 4 */ uint32_t uid; /* 25568 4 */ uint32_t gid; /* 25572 4 */ int32_t flow_id; /* 25576 4 */ int32_t flow; /* 25580 4 */ int32_t flow_watermark; /* 25584 4 */ uint32_t flow_sleep; /* 25588 4 */ uint64_t offset_increment; /* 25592 8 */ /* --- cacheline 400 boundary (25600 bytes) --- */ uint64_t number_ios; /* 25600 8 */ uint64_t latency_target; /* 25608 8 */ uint64_t latency_window; /* 25616 8 */ uint64_t max_latency; /* 25624 8 */ fio_fp64_t latency_percentile; /* 25632 16 */ libfio.c initialize_fio() excerpt: /* * We need these to be properly 64-bit aligned, otherwise we * can run into problems on archs that fault on unaligned fp * access (ARM). */ compiletime_assert((offsetof(struct thread_options_pack, zipf_theta) % 8) == 0, "zipf_theta"); compiletime_assert((offsetof(struct thread_options_pack, pareto_h) % 8) == 0, "pareto_h"); compiletime_assert((offsetof(struct thread_options_pack, percentile_list) % 8) == 0, "percentile_list"); compiletime_assert((offsetof(struct thread_options_pack, latency_percentile) % 8) == 0, "latency_percentile");