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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to