linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo@conectiva.com.br>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Rik van Riel <riel@conectiva.com.br>,
	"Stephen C. Tweedie" <sct@redhat.com>
Cc: linux-mm@kvack.org
Subject: Count swap faults which need to read data from the swap area as major faults
Date: Tue, 3 Apr 2001 20:11:56 -0300 (BRT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0104032010010.7175-100000@freak.distro.conectiva> (raw)

Hi, 

Right now we are not accounting faults which nee to read data from swap as
major faults. 

The following patch should fix that. 

Against -ac28. (probably applies against 2.4.3-ac2) 

--- linux/mm/memory.c.orig	Tue Apr  3 21:30:03 2001
+++ linux/mm/memory.c	Tue Apr  3 21:32:18 2001
@@ -1112,6 +1112,7 @@
 {
 	struct page *page;
 	pte_t pte;
+	int ret = 1;
 
 	spin_unlock(&mm->page_table_lock);
 	page = lookup_swap_cache(entry);
@@ -1125,6 +1126,9 @@
 			return -1;
 		}
 
+		/* Had to read the page from swap area: Major fault */
+		ret = 2;
+
 		flush_page_to_ram(page);
 		flush_icache_page(vma, page);
 	}
@@ -1160,7 +1164,7 @@
 
 	/* No need to invalidate - it was non-present before */
 	update_mmu_cache(vma, address, pte);
-	return 1;	/* Minor fault */
+	return ret;
 }
 
 /*

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

             reply	other threads:[~2001-04-03 23:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-03 23:11 Marcelo Tosatti [this message]
2001-04-04  1:08 ` Rik van Riel

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=Pine.LNX.4.21.0104032010010.7175-100000@freak.distro.conectiva \
    --to=marcelo@conectiva.com.br \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-mm@kvack.org \
    --cc=riel@conectiva.com.br \
    --cc=sct@redhat.com \
    /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