How to artificially cause a page fault in linux kernel?

Let’s learn how to artificially cause a page fault in linux kernel. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

How to artificially cause a page fault in Linux kernel?

I am pretty new to the Linux kernel. I would like to make the kernel fault every time a specified page 'P' is being fetched. One simple conceptual idea is to clear the bit indicating the presence of page 'P' in Page Table Entry (PTE). Can anyone provide more details on how to go about achieving this in x86? Also please point me to where in the source code one needs to make this modification, if possible. Background I have to invoke my custom page handler which is applicable only for handling...

Answer:

I have not played with the swapping code since I moved from Minix to Linux, but a swapping algorithm...

Read more

Paarth at Stack Overflow Mark as irrelevant Undo

Other solutions

Why is Linux kernel unable to handle page faults generated with in the kernel?

Kernel cannot handle its own page fault.  That is the reason why we have to use copyt_to_user and copy_from_user. Why can't it do as following: If a page fault happens an interrupt will be raised and that invokes the kernel , now the kernel can load...

Answer:

A very detailed explanation can be found at:https://www.kernel.org/doc/Docum...This explains the handling...

Read more

Udipta Das at Quora Mark as irrelevant Undo

When accessing a given address, how does the Linux kernel know that a particular page is mmaped?

I want to know, given an address X, how does the Linux kernel figure out that X is an mmaped page? Is there a special flag in the page table entry? Does the access generate a page fault ? If so, how does the handler find out it is an mmaped address?

Answer:

When you first access an mmaped page, the page fault handler runs. On most architectures, this invokes...

Read more

Robert Love at Quora Mark as irrelevant Undo

Mac OS Kernel Panic Issue?

Today my mom was using our Mac OS X computer. The sound, as of recently, has been randomly turning on and off. So we restart the computer, and it fixes it. Today my mom restarted to computer to fix the sound, and it popped up with a kernel panic that...

Answer:

Corrupted OS file or resource seems the most likely cause. It seems to be saying that the hardware is...

Read more

Basch at Yahoo! Answers Mark as irrelevant Undo

What is the order (in terms of time consumption) of: context switch, minor/major page fault, read from main memory and register access?

A minor page fault is definitely cheaper than a major page fault because it just needs to update the page table and needs not read from disk (a major page fault does).   A read from main memory should be faster than any of the page fault situations but...

Answer:

The expense of a page fault is dependent on its type. Simple access to memory for which there is no...

Read more

Creed Erickson at Quora Mark as irrelevant Undo

How can one create interface between kernel and LKM (Linux Kernel Module)?.

How can one intercept calls made by Kernel module to kernel without kedr using kernel module in c.  Or rephrase it as how can one create interface between kernel and Linux Kernel Module (LKM).

Answer:

Can you be please more specific about the interface you need, what it does and what are its functionalities...

Read more

Nitin Chaudhary at Quora Mark as irrelevant Undo

What is the best resource to understand I/O, memory management, and multicores in Linux?

I have read understanding the linux kernel book, but still I don't understand how I/O is handled. Below are few confusion points. I/O devices 1. How is DMA involved in I/O transfer? 2. How does Asynchronous I/O read works? I mean how does OS know which...

Answer:

I'd like to recommend two textbooks which cover a lot of this material: Computer Organization and Design...

Read more

Andrew Wang at Quora Mark as irrelevant Undo

What are the key differences between Linux kernel 2.6 and Linux kernel 3.0?

I just want to know what are new thing incorporates in kernel 3.0-rc3 or what are the differences between kernel 2.6.xx and kernel 3.0-rc3.

Answer:

While Mr. C is correct I might mention some fun I've been having since reinstalling Slackware to illustrate...

Read more

5QZ33QLKOHEAPERMKZVX4WJTCU at Yahoo! Answers Mark as irrelevant Undo

I have debian linux (kernel 2.4 i think) and i want to set it up as a webserver?

Again : I have debian linux with a 2.4 kernel (i think) and during the installation of this version i installed the desktop enviroment package. I saw that there was a webserver option but i didnt select it at that time but i now want to install that...

Answer:

Hello, Try uname -a, to find out what version of the kernel you are using. You have big plans for something...

Read more

David at Yahoo! Answers Mark as irrelevant Undo

What are the ways to get advanced knowledge in linux kernel after learning the basics?

I have been working with linux kernel for quite sometime. I have  completed some books (esp. Linux Kernel Development by Robert love and  LDD3e by Rubini). I have been reading linux codes. I am able to write  simple linux drivers and do other basic things...

Answer:

Since Linux is an open-source project, you should consider looking into existing bugs, feature requests...

Read more

Costya Perepelitsa at Quora Mark as irrelevant Undo

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.