why this field is taskstats. ac_sched is specifically aligned as 8?
Greg KH
greg at kroah.com
Fri Dec 15 07:58:14 EST 2017
On Fri, Dec 15, 2017 at 08:16:45PM +0800, Shiyao MA wrote:
> Hi,
>
> http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/taskstats.h#L107
>
> Why the field is taskstats. ac_sched aligned as 8 ?
Think about the field layout in memory if that variable was _not_
aligned as 8. What would happen to accessing all of the variables after
that in the structure? Would that work as efficiently?
Memory layout matters on structures that are accessed very frequently :)
hope this helps,
greg k-h
More information about the Kernelnewbies
mailing list