LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-24-2012, 01:08 AM   #1
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Rep: Reputation: Disabled
kernel memory


Hi
I am reading linux kernel development (Robert love, third edition), I hit upon a line which states "kernel memory is not pageable"

My understanding is that physical memory (RAM) is divided into pages (size of 4KB etc, based on configuration).

Can someone help in with the meaning of the statement "kernel memory is not pageable" ... RAM is divided into pages right? or it means that those pages which are allocated for kernel are not swapable?

I googled (http://www.google.co.in/search?q=ker...-a&safe=active) but I couldnt get satisfactory answer.

I am a newbie in kernel and any pointers/link will help me..

thanks
 
Old 09-24-2012, 01:38 AM   #2
rosehosting.com
Member
 
Registered: Jun 2012
Location: Missouri, USA
Posts: 236

Rep: Reputation: 64
Hello vrs,

I am not linux kernel developer but the following google search may be more useful to you.

also, you may want to check this http://comments.gmane.org/gmane.linu...lnewbies/41877

HTH
 
Old 09-24-2012, 02:36 AM   #3
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
thanks...
in simple layman terms, it means those pages are not swappable. they *will* be in RAM for ever.
 
Old 09-24-2012, 03:13 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you mixed the verb paging and the noun page. The memory is divided into pages (noun), or blocks. The memory can be swapped or paged (verb).
The kernel memory is always part of the main physical memory, it cannot be swapped.
 
Old 09-24-2012, 03:19 AM   #5
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Memory is divided into pages, so when we say "The memory is paged", it means that portion of memory is "pinned" at physical (main) memory.
Please correct me if wrong...

Thanks again
 
Old 09-24-2012, 03:30 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
see here: http://en.wikipedia.org/wiki/Paging. The paged memory is currently not available, because it is now located in the swap area (a bit similar to a book and the pages, it is "another" page, not the one what you currently reading). The kernel memory cannot be paged, it means it is pinned.
 
1 members found this post helpful.
Old 09-24-2012, 03:32 AM   #7
vrs
LQ Newbie
 
Registered: Jul 2012
Posts: 21

Original Poster
Rep: Reputation: Disabled
Got it, thanks...
 
Old 09-24-2012, 08:42 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Since the kernel is the portion of the system that is responsible for the implementation of virtual-memory paging, there must always be an "always resident" portion of the kernel which can never experience page-faults itself.

If the microprocessor, in handling a page-fault interrupt, determines that the page-fault handler itself is not resident in memory, the processor itself will halt ... quicker than a tennis match ... with a so-called "double fault."

This does not mean that code within the kernel cannot experience a page-fault. In fact, that's one of the reasons for the "kernel thread" architecture, which also allows kernel-code to start I/O operations and to wait for those operations to be completed. But all of the code that is directly or indirectly responsible for handling CPU and/or hardware interrupts must at all times be permanently resident.

The kernel accomplishes this by setting up segment and page-table entries which map these areas of memory as what we old IBMers would call "virtual = real." And these pages are locked so that no part of the virtual-memory system will ever, ever consider them eligible for swap ... "no way, no how, no matter how drunk you are." Now, the processor can be put into virtual-memory mode by the so-called "trampoline," and it can (and does...) stay that way forever.

Last edited by sundialsvcs; 09-24-2012 at 08:45 AM.
 
  


Reply



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
Creating memory chunk in kernel memory libee Linux - Newbie 0 03-28-2012 05:03 AM
SHM Memory Counted as Cache Memory with Kernel 2.6.18? kresyzig Programming 4 08-25-2010 11:06 PM
Kernel virtual memory map TO Board memory map -----> Mapping !rajkums! Linux - Embedded & Single-board computer 0 10-18-2008 09:21 AM
kernel: how do pci-memory a conventional memory? vv40in Linux - Newbie 0 06-05-2008 02:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:00 PM.

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
Open Source Consulting | Domain Registration