LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-13-2020, 10:25 AM   #1
danielNJ
LQ Newbie
 
Registered: Feb 2020
Posts: 1

Rep: Reputation: Disabled
Cramming page metadata into struct page


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:
Code:
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?

Last edited by danielNJ; 02-13-2020 at 01:03 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Image viewer that supports editing metadata and sorting/viewing by metadata? ahc_fan Linux - Software 1 12-02-2015 12:08 PM
g++ and wrong struct member addresses / struct size misreporting sonajiso Linux - General 5 05-22-2004 11:16 PM
switch statement converting struct char to struct int oceaneyes2 Programming 2 12-10-2003 05:30 PM
using struct type X as pointer in struct X. worldmagic Programming 1 10-28-2003 03:06 PM
Accessing a struct inside struct cxel91a Programming 1 09-17-2003 05:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 07:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration