All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Liu <lliubbo@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, kosaki.motohiro@jp.fujitsu.com,
	Bob Liu <lliubbo@gmail.com>
Subject: [RESEND][PATCH] __isolate_lru_page:skip unneeded "not"
Date: Thu,  1 Apr 2010 21:37:35 +0800	[thread overview]
Message-ID: <1270129055-3656-1-git-send-email-lliubbo@gmail.com> (raw)

PageActive(page) will return int 0 or 1, mode is also int 0 or 1,
they are comparible so "not" is unneeded to be sure to boolean
values.
I also collected the ISOLATE_BOTH check together.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
---
 mm/vmscan.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index e0e5f15..ce9ee85 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -862,16 +862,11 @@ int __isolate_lru_page(struct page *page, int mode, int file)
 	if (!PageLRU(page))
 		return ret;
 
-	/*
-	 * When checking the active state, we need to be sure we are
-	 * dealing with comparible boolean values.  Take the logical not
-	 * of each.
-	 */
-	if (mode != ISOLATE_BOTH && (!PageActive(page) != !mode))
-		return ret;
-
-	if (mode != ISOLATE_BOTH && page_is_file_cache(page) != file)
-		return ret;
+	if (mode != ISOLATE_BOTH) {
+		if ((PageActive(page) != mode) ||
+			(page_is_file_cache(page) != file))
+				return ret;
+	}
 
 	/*
 	 * When this function is being called for lumpy reclaim, we
-- 
1.5.6.3

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

             reply	other threads:[~2010-04-01 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01 13:37 Bob Liu [this message]
2010-04-02 22:05 ` [RESEND][PATCH] __isolate_lru_page:skip unneeded "not" Andrew Morton
2010-04-02 22:25   ` Bob Liu
2010-04-02 23:01     ` Andrew Morton

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=1270129055-3656-1-git-send-email-lliubbo@gmail.com \
    --to=lliubbo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.