mm/lru: simplify is_file_lru() and is_active_lru()
Subsystems (3)
PATCH 1/1 mm/lru: simplify is_file_lru() and is_active_lru()
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 <[email protected]>
--- include/linux/mmzone.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/mmzone.h +2 -2
@@ -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
Signature · 1 line
2.29.0
Quoted 31 lines · Hui Su
page->lrubit 0 can tell whether the page is avtive page or not.page->lrubit 1 can tell whether the page is file page or not.Signed-off-by Hui Su <[email protected]>--- include/linux/mmzone.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)include/linux/mmzone.h +2
-2@@ -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 2Signature · 1 line
2.29.0
The commit message is not correct, please ignore this change.
Quoted 4 lines · Hui Su
page->lrubit 0 can tell whether the page is avtive page or not.page->lrubit 1 can tell whether the page is file page or not.
This is wrong. I'll let you figure out why.