Re: why this field is taskstats. ac_sched is specifically aligned as 8?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux