X86_64 kernel memory architecture

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm porting my test memory allocator from i386 to
x86_64 (Xeon) systems for learning purposes. It
creates zone banks of 4K (single 4K pages) and 64K (16
4K pages virtually contiguous).

For this reason, I track them using a bitfield. Since
my system has 4GB of ram, allotting 1 bit per 4K page
helps me keep track of all the pages in a system
having 4GB of ram using only 128K of additional
memory.

On x86_64, since all memory is mapped from
0xffff810000000000 onwards, I believe if I assign a
bit for each 4K page from this address onwards, I can
track all pages in the system.

However, alloc_pages() returns address like
0xffff810106bce000 which falls out of the linear 4GB
range from 0xffff810000000000 onwards.

So it seems the memory mapping is not linear.

So my question is how do I know:
1) which is the lowest possible kernel virtual address
that can ever by allocated to by by
alloc_pages/get_free_pages?

2) is the kernel memory virtually contiguous?

3) if the kernel memory is not virtually contiguous,
how to I use simple bitfield and address math to keep
track of these disperse addresses?

Thanks
Rock




 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux