public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <pekka.enberg@ri.fi>
To: riel@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] mm: thrashing control cleanups
Date: Sat, 26 Mar 2005 10:14:16 +0200	[thread overview]
Message-ID: <1111824856.9431.2.camel@localhost> (raw)

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;
 		}



             reply	other threads:[~2005-03-26  8:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-26  8:14 Pekka Enberg [this message]
2005-03-26  8:30 ` [PATCH] mm: thrashing control cleanups Pekka Enberg

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=1111824856.9431.2.camel@localhost \
    --to=pekka.enberg@ri.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@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