All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hui Su <sh_def@163.com>
To: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Cc: sh_def@163.com
Subject: [PATCH] mm/lru: simplify is_file_lru() and is_active_lru()
Date: Wed, 18 Nov 2020 00:49:19 +0800	[thread overview]
Message-ID: <20201117164919.GA82821@rlk> (raw)

page->lru bit 0 can tell whether the page is
avtive page or not.
page->lru bit 1 can tell whether the page is
file page or not.

Signed-off-by: Hui Su <sh_def@163.com>
---
 include/linux/mmzone.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index fb3bf696c05e..294369c652d0 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -258,12 +258,12 @@ enum lru_list {
 
 static inline bool is_file_lru(enum lru_list lru)
 {
-	return (lru == LRU_INACTIVE_FILE || lru == LRU_ACTIVE_FILE);
+	return lru & LRU_FILE;
 }
 
 static inline bool is_active_lru(enum lru_list lru)
 {
-	return (lru == LRU_ACTIVE_ANON || lru == LRU_ACTIVE_FILE);
+	return lru & LRU_ACTIVE;
 }
 
 #define ANON_AND_FILE 2
-- 
2.29.0



             reply	other threads:[~2020-11-17 16:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 16:49 Hui Su [this message]
2020-11-17 16:53 ` [PATCH] mm/lru: simplify is_file_lru() and is_active_lru() Hui Su
2020-11-17 17:40 ` Matthew Wilcox
2020-11-17 17:12 Hui Su
2020-11-17 17:41 ` Matthew Wilcox
2020-11-17 17:46   ` Hui Su
2020-11-17 17:47     ` Matthew Wilcox
2020-11-17 17:56       ` Hui Su
2020-11-17 17:59         ` Matthew Wilcox
2020-11-17 18:05           ` Hui Su
2020-11-20 19:08           ` Hui Su

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=20201117164919.GA82821@rlk \
    --to=sh_def@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --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.