Skip to contentSkip to conversation

Load-on-demand. How does the kernel locate the pages on secondary storage?

DISCUSSION Mohamed El Dawy 3 participants 3 messages Dec 7, 2005

lore
Share & tools
lore
#0 lore raw

Hi,
Assume we have a process running, not all the pages of the process
are in main memory. Some are swapped, and some are just not loaded yet.
How does the kernel locate those pages on disk? Is there a pointer in the page table? or is there some place else? Any pointers to source code in the kernel would be greatly appreciated.

Thank you very much.

#1 lore raw
Quoted 6 lines · Mohamed El Dawy

Assume we have a process running, not all the pages of the process
are in main memory. Some are swapped, and some are just not loaded yet.
How does the kernel locate those pages on disk? Is there a pointer in the page table? or is there some place else? Any pointers to source code in the kernel would be greatly appreciated.

http://linux-mm.org/PageFaultHandling

Signature · 1 line
All Rights Reversed
#2 lore raw
Quoted 9 lines · Rik van Riel
Quoted 6 lines · Mohamed El Dawy

Assume we have a process running, not all the pages of the process
are in main memory. Some are swapped, and some are just not loaded yet.
How does the kernel locate those pages on disk? Is there a pointer in the page table? or is there some place else? Any pointers to source code in the kernel would be greatly appreciated.

Quoted 4 lines

http://linux-mm.org/PageFaultHandling

--
All Rights Reversed

Look at /usr/src/linux-uname -r/mm/swapfile.c scan_swap_map() for a hint. They are indexed using cluster numbers and it's an easy index because the swap i/o is in pages.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips). Warning : 98.36% of all statistics are fiction.
.

****************************************************************
The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.