Article 4ZAN5 Cramming page metadata into struct page

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:
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().
*/
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?latest?d=yIl2AUoC8zA latest?i=vzB6dbpX6qA:VudlW-97BpY:F7zBnMy latest?i=vzB6dbpX6qA:VudlW-97BpY:V_sGLiP latest?d=qj6IDK7rITs latest?i=vzB6dbpX6qA:VudlW-97BpY:gIN9vFwvzB6dbpX6qA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments