Cramming page metadata into struct page
by danielNJ from LinuxQuestions.org on (#4ZAN5)
I asked this same question on stack overflow (here), but haven't gotten any responses. Here is my question:
I am looking at the definition of Code:struct page in the file linux/mm_types.h. My question is in regards to the comment at the top of the definition:
Quote:
If I want to use these 20 bytes to store metadata about a page, how would I do so? Is there anything that I would need to check before overwriting those addresses, so that I don't corrupt any valid data that was supposed to be there?


I am looking at the definition of Code:struct page in the file linux/mm_types.h. My question is in regards to the comment at the top of the definition:
Quote:
| struct page { unsigned long flags;/* Atomic flags, some possibly * updated asynchronously */ /* * Five words (20/40 bytes) are available in this union. * WARNING: bit 0 of the first word is used for PageTail(). That * means the other users of this union MUST NOT use the bit to * avoid collision and false-positive PageTail(). */ |