public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: thrashing control cleanups
@ 2005-03-26  8:14 Pekka Enberg
  2005-03-26  8:30 ` Pekka Enberg
  0 siblings, 1 reply; 2+ messages in thread
From: Pekka Enberg @ 2005-03-26  8:14 UTC (permalink / raw)
  To: riel; +Cc: linux-kernel

Hi,

This patch removes one redundant variable from mm/thrash.c and
moves the declaration of one variable closer to the block where
it is actually used.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---

 thrash.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

Index: kernel/2.6/mm/thrash.c
===================================================================
--- kernel.orig/2.6/mm/thrash.c	2005-03-26 09:52:50.000000000 +0200
+++ kernel/2.6/mm/thrash.c	2005-03-26 10:00:58.000000000 +0200
@@ -51,9 +51,6 @@
  */
 void grab_swap_token(void)
 {
-	struct mm_struct *mm;
-	int reason;
-
 	/* We have the token. Let others know we still need it. */
 	if (has_swap_token(current->mm)) {
 		current->mm->recent_pagein = 1;
@@ -61,6 +58,7 @@
 	}
 
 	if (time_after(jiffies, swap_token_check)) {
+		int reason;
 
 		/* Can't get swapout protection if we exceed our RSS limit. */
 		// if (current->mm->rss > current->mm->rlimit_rss)
@@ -75,13 +73,12 @@
 
 		swap_token_check = jiffies + SWAP_TOKEN_CHECK_INTERVAL;
 
-		mm = swap_token_mm;
-		if ((reason = should_release_swap_token(mm))) {
+		if ((reason = should_release_swap_token(swap_token_mm))) {
 			unsigned long eligible = jiffies;
 			if (reason == SWAP_TOKEN_TIMED_OUT) {
 				eligible += swap_token_default_timeout;
 			}
-			mm->swap_token_time = eligible;
+			swap_token_mm->swap_token_time = eligible;
 			swap_token_timeout = jiffies + swap_token_default_timeout;
 			swap_token_mm = current->mm;
 		}



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

* [PATCH] mm: thrashing control cleanups
  2005-03-26  8:14 [PATCH] mm: thrashing control cleanups Pekka Enberg
@ 2005-03-26  8:30 ` Pekka Enberg
  0 siblings, 0 replies; 2+ messages in thread
From: Pekka Enberg @ 2005-03-26  8:30 UTC (permalink / raw)
  To: riel; +Cc: linux-kernel

Hi,

Here's a version that applies with -p1. Quilt did some silly things to
the previous one...

This patch removes one redundant variable from mm/thrash.c and moves
declaration of one variable closer to the block where it is actually used.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---

 thrash.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

Index: 2.6/mm/thrash.c
===================================================================
--- 2.6.orig/mm/thrash.c	2005-03-26 09:52:50.000000000 +0200
+++ 2.6/mm/thrash.c	2005-03-26 10:00:58.000000000 +0200
@@ -51,9 +51,6 @@
  */
 void grab_swap_token(void)
 {
-	struct mm_struct *mm;
-	int reason;
-
 	/* We have the token. Let others know we still need it. */
 	if (has_swap_token(current->mm)) {
 		current->mm->recent_pagein = 1;
@@ -61,6 +58,7 @@
 	}
 
 	if (time_after(jiffies, swap_token_check)) {
+		int reason;
 
 		/* Can't get swapout protection if we exceed our RSS limit. */
 		// if (current->mm->rss > current->mm->rlimit_rss)
@@ -75,13 +73,12 @@
 
 		swap_token_check = jiffies + SWAP_TOKEN_CHECK_INTERVAL;
 
-		mm = swap_token_mm;
-		if ((reason = should_release_swap_token(mm))) {
+		if ((reason = should_release_swap_token(swap_token_mm))) {
 			unsigned long eligible = jiffies;
 			if (reason == SWAP_TOKEN_TIMED_OUT) {
 				eligible += swap_token_default_timeout;
 			}
-			mm->swap_token_time = eligible;
+			swap_token_mm->swap_token_time = eligible;
 			swap_token_timeout = jiffies + swap_token_default_timeout;
 			swap_token_mm = current->mm;
 		}



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

end of thread, other threads:[~2005-03-26  8:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-26  8:14 [PATCH] mm: thrashing control cleanups Pekka Enberg
2005-03-26  8:30 ` Pekka Enberg

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