linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Teo <eugene.teo@eugeneteo.net>
To: linux-mm@kvack.org
Subject: Understanding page faults code in mm/memory.c
Date: Thu, 31 Jul 2003 19:15:02 +0800	[thread overview]
Message-ID: <20030731111502.GA1591@eugeneteo.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1706 bytes --]

Hi there,

With reference to 2.4.20, I have a few questions:

[1] I was looking at mm/memory.c. I noticed that there is a 
difference between minor, and major faults. My guess is that
when a major fault occurs, the mm performs a page-in from the
swap to the memory, whilst a minor fault doesn't? No?

[2] I understand that for the handle_pte_fault routine, the
if structure basically handles page-in. I am trying to figure
out where I can find the code for page-out which I understand
it can be involved the swap, etc. Can someone give me some
pointers as to where I can look for:

    - what causes page-outs,
    - where in the kernel can i look for them?

[3] in mm/memory.c, in do_wp_page, I am not sure what the
portion of code is about:

// If old_page bit is not set, set it, and test.
if (!TryLockPage(old_page) {

    // [QN:] I don't understand what can_share_swap_page() do
    // I tried tracing, but i still don't quite get it.
    int reuse = can_share_swap_page(old_page);    
    unlock_page(old_page);
    if (reuse) {
        // flush the old mapping out of the tlb.
        fluse_cache_page(vma, address);
        
        // creates a new mapping with entry in the page table        
        // [QN:] What is pte_mkyoung?
        establish_pte(vma, address, page_table, pte_mkyoung(...
        
        spin_unlock(&mm->page_table_lock);

        // [QN:] why didn't the mm->rss increased since it is
        // a minor fault? hmm, i am not sure what minor
        // fault is though.
        return 1; /* minor fault */
    }
}    

Hear from you guys. Thank you so much.

Cheers,
Eugene
(posted this in another mailing list before)


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2003-07-31 11:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-31 11:15 Eugene Teo [this message]
2003-07-31 11:47 ` Mel Gorman
2003-07-31 16:12   ` Raghu R. Arur
2003-07-31 17:06     ` Mel Gorman
2003-07-31 17:11       ` Raghu R. Arur
2003-07-31 18:20         ` Mel Gorman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030731111502.GA1591@eugeneteo.net \
    --to=eugene.teo@eugeneteo.net \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox