linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 1/2] Swap token re-tuned
@ 2006-09-28 14:06 Ashwin Chaugule
  0 siblings, 0 replies; 3+ messages in thread
From: Ashwin Chaugule @ 2006-09-28 14:06 UTC (permalink / raw)
  To: linux-mm

Try to grab swap token before the VM selects pages for eviction.


Signed-off-by: Ashwin Chaugule <ashwin.chaugule@celunite.com>

-- 

diff --git a/mm/filemap.c b/mm/filemap.c
index afcdc72..190d2c1 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1478,8 +1478,8 @@ no_cached_page:
     * We're only likely to ever get here if MADV_RANDOM is in
     * effect.
     */
+    grab_swap_token(); /* Contend for token _before_ we read-in */
    error = page_cache_read(file, pgoff);
-    grab_swap_token();

    /*
     * The page we want has now been added to the page cache.
diff --git a/mm/memory.c b/mm/memory.c
index 92a3ebd..52eb9b8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1974,6 +1974,7 @@ static int do_swap_page(struct mm_struct
    delayacct_set_flag(DELAYACCT_PF_SWAPIN);
    page = lookup_swap_cache(entry);
    if (!page) {
+        grab_swap_token(); /* Contend for token _before_ we read-in */
         swapin_readahead(entry, address, vma);
         page = read_swap_cache_async(entry, vma, address);
        if (!page) {
@@ -1991,7 +1992,6 @@ static int do_swap_page(struct mm_struct
        /* Had to read the page from swap area: Major fault */
        ret = VM_FAULT_MAJOR;
        count_vm_event(PGMAJFAULT);
-        grab_swap_token();
    }

    delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
-- 


--
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-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [RFC][PATCH 1/2] Swap token re-tuned
@ 2006-09-28 14:09 Ashwin Chaugule
  0 siblings, 0 replies; 3+ messages in thread
From: Ashwin Chaugule @ 2006-09-28 14:09 UTC (permalink / raw)
  To: linux-mm

Try to grab swap token before the VM selects pages for eviction.


Signed-off-by: Ashwin Chaugule <ashwin.chaugule@celunite.com>

-- 

diff --git a/mm/filemap.c b/mm/filemap.c
index afcdc72..190d2c1 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1478,8 +1478,8 @@ no_cached_page:
     * We're only likely to ever get here if MADV_RANDOM is in
     * effect.
     */
+    grab_swap_token(); /* Contend for token _before_ we read-in */
    error = page_cache_read(file, pgoff);
-    grab_swap_token();

    /*
     * The page we want has now been added to the page cache.
diff --git a/mm/memory.c b/mm/memory.c
index 92a3ebd..52eb9b8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1974,6 +1974,7 @@ static int do_swap_page(struct mm_struct
    delayacct_set_flag(DELAYACCT_PF_SWAPIN);
    page = lookup_swap_cache(entry);
    if (!page) {
+        grab_swap_token(); /* Contend for token _before_ we read-in */
         swapin_readahead(entry, address, vma);
         page = read_swap_cache_async(entry, vma, address);
        if (!page) {
@@ -1991,7 +1992,6 @@ static int do_swap_page(struct mm_struct
        /* Had to read the page from swap area: Major fault */
        ret = VM_FAULT_MAJOR;
        count_vm_event(PGMAJFAULT);
-        grab_swap_token();
    }

    delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
-- 


--
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-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [RFC][PATCH 1/2] Swap token re-tuned
@ 2006-09-28 16:58 Ashwin Chaugule
  0 siblings, 0 replies; 3+ messages in thread
From: Ashwin Chaugule @ 2006-09-28 16:58 UTC (permalink / raw)
  To: linux-mm

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

Sorry about that, I was'nt aware of the Thunderbird issue.
Sending the patches again. 
Thanks Peter !

-Ashwin

Try to grab swap token before the VM selects pages for eviction. 


Signed-off-by: Ashwin Chaugule <ashwin.chaugule@celunite.com>


[-- Attachment #2: swap-token-patch1 --]
[-- Type: text/x-patch, Size: 1150 bytes --]

diff --git a/mm/filemap.c b/mm/filemap.c
index afcdc72..190d2c1 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1478,8 +1478,8 @@ no_cached_page:
 	 * We're only likely to ever get here if MADV_RANDOM is in
 	 * effect.
 	 */
+	grab_swap_token(); /* Contend for token _before_ we read-in */
 	error = page_cache_read(file, pgoff);
-	grab_swap_token();
 
 	/*
 	 * The page we want has now been added to the page cache.
diff --git a/mm/memory.c b/mm/memory.c
index 92a3ebd..52eb9b8 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1974,6 +1974,7 @@ static int do_swap_page(struct mm_struct
 	delayacct_set_flag(DELAYACCT_PF_SWAPIN);
 	page = lookup_swap_cache(entry);
 	if (!page) {
+		grab_swap_token(); /* Contend for token _before_ we read-in */
  		swapin_readahead(entry, address, vma);
  		page = read_swap_cache_async(entry, vma, address);
 		if (!page) {
@@ -1991,7 +1992,6 @@ static int do_swap_page(struct mm_struct
 		/* Had to read the page from swap area: Major fault */
 		ret = VM_FAULT_MAJOR;
 		count_vm_event(PGMAJFAULT);
-		grab_swap_token();
 	}
 
 	delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
diff --git a/mm/thrash.c b/mm/thrash.c

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-28 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-28 14:06 [RFC][PATCH 1/2] Swap token re-tuned Ashwin Chaugule
2006-09-28 14:09 Ashwin Chaugule
2006-09-28 16:58 Ashwin Chaugule

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox