#define _define_initcall(level,fn,id) \

static initcall_t _initcall_##fn##id _attribute_used_ \

_attribute_((_section_(".initcall" level ".init"))) = fn

□ align specifies the minimum alignment of data — in other words, their alignment in memory. The attribute requires an integer argument that must be divisible by the memory address (at which the data are held) without a remainder. The unit used is bytes.

This attribute is important for the kernel because it allows maximum use to be made of CPU caches by placing the key parts of a structure at the best place in memory.

The_cacheline_aligned macro, for example, is defined as follows:

Continue reading here: Info

Was this article helpful?

0 0