LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-30-2011, 07:34 AM   #1
hamedn
LQ Newbie
 
Registered: Sep 2009
Posts: 22

Rep: Reputation: 0
CR3 of Kernel thread


Dear members,

As you know, at least I think that the Linux kernel is single thread entity and cr3 for whole of the kernel must be the same, but when I tried to read the cr3's value using a kernel module, each time, I have obtained different one for it. I'm wondering if someone could help me to unravel this problem.

Thanks in advance
 
Old 10-30-2011, 11:13 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,671
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
With all due respect ... "Google it," and instantly read the last umpty-leven times this very same question has been answered.

Changing the CR3 value is expensive, and from the point of view of running kernel-code, completely unnecessary. Changing this register causes the CPU to flush a lot of caches that it'd rather not flush if it doesn't have to, and there's no reason to do it (and every reason not to ...) until a different user-land process is actually selected. The system might ping-pong between user mode and kernel mode dozens of times before deciding to switch to a different virtual-memory context.

Last edited by sundialsvcs; 10-30-2011 at 11:14 PM.
 
  


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
Problem accessing control registers (cr0,cr2,cr3) Phobios Programming 1 09-15-2011 01:44 PM
thread creating another thread on 2.4 kernel after long run ashok449 Linux - Kernel 1 02-20-2009 04:26 AM
Signaling mechanism in Kernel Thread in kernel 2.6 and 2.4 amit_bst Linux - Kernel 3 07-24-2006 10:21 PM

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

All times are GMT -5. The time now is 07:51 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