Info

struct work_struct {

data was represented by a pointer as expected. However, the kernel does use a little trick — which is fairly on the edge of being dirty — to squeeze more information into the structure without spending more memory. Because pointers are aligned on 4-byte boundaries on all supported architectures, the first 2 bits are guaranteed to be zero. They are therefore abused to contain flag bits. The remaining bits hold the pointer information as usual. The following macros allow masking out the flag bits:

Continue reading here: Info

Was this article helpful?

0 0