Commit 42e2e457 authored by Yaowei Bai's avatar Yaowei Bai Committed by Linus Torvalds

mm/vmscan: make inactive_anon/file_is_low return bool

Make inactive_anon/file_is_low return bool due to these particular
functions only using either one or zero as their return value.

No functional change.
Signed-off-by: default avatarYaowei Bai <bywxiaobai@163.com>
Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 80f73b4b
...@@ -1859,7 +1859,7 @@ static void shrink_active_list(unsigned long nr_to_scan, ...@@ -1859,7 +1859,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
} }
#ifdef CONFIG_SWAP #ifdef CONFIG_SWAP
static int inactive_anon_is_low_global(struct zone *zone) static bool inactive_anon_is_low_global(struct zone *zone)
{ {
unsigned long active, inactive; unsigned long active, inactive;
...@@ -1876,14 +1876,14 @@ static int inactive_anon_is_low_global(struct zone *zone) ...@@ -1876,14 +1876,14 @@ static int inactive_anon_is_low_global(struct zone *zone)
* Returns true if the zone does not have enough inactive anon pages, * Returns true if the zone does not have enough inactive anon pages,
* meaning some active anon pages need to be deactivated. * meaning some active anon pages need to be deactivated.
*/ */
static int inactive_anon_is_low(struct lruvec *lruvec) static bool inactive_anon_is_low(struct lruvec *lruvec)
{ {
/* /*
* If we don't have swap space, anonymous page deactivation * If we don't have swap space, anonymous page deactivation
* is pointless. * is pointless.
*/ */
if (!total_swap_pages) if (!total_swap_pages)
return 0; return false;
if (!mem_cgroup_disabled()) if (!mem_cgroup_disabled())
return mem_cgroup_inactive_anon_is_low(lruvec); return mem_cgroup_inactive_anon_is_low(lruvec);
...@@ -1891,9 +1891,9 @@ static int inactive_anon_is_low(struct lruvec *lruvec) ...@@ -1891,9 +1891,9 @@ static int inactive_anon_is_low(struct lruvec *lruvec)
return inactive_anon_is_low_global(lruvec_zone(lruvec)); return inactive_anon_is_low_global(lruvec_zone(lruvec));
} }
#else #else
static inline int inactive_anon_is_low(struct lruvec *lruvec) static inline bool inactive_anon_is_low(struct lruvec *lruvec)
{ {
return 0; return false;
} }
#endif #endif
...@@ -1911,7 +1911,7 @@ static inline int inactive_anon_is_low(struct lruvec *lruvec) ...@@ -1911,7 +1911,7 @@ static inline int inactive_anon_is_low(struct lruvec *lruvec)
* This uses a different ratio than the anonymous pages, because * This uses a different ratio than the anonymous pages, because
* the page cache uses a use-once replacement algorithm. * the page cache uses a use-once replacement algorithm.
*/ */
static int inactive_file_is_low(struct lruvec *lruvec) static bool inactive_file_is_low(struct lruvec *lruvec)
{ {
unsigned long inactive; unsigned long inactive;
unsigned long active; unsigned long active;
...@@ -1922,7 +1922,7 @@ static int inactive_file_is_low(struct lruvec *lruvec) ...@@ -1922,7 +1922,7 @@ static int inactive_file_is_low(struct lruvec *lruvec)
return active > inactive; return active > inactive;
} }
static int inactive_list_is_low(struct lruvec *lruvec, enum lru_list lru) static bool inactive_list_is_low(struct lruvec *lruvec, enum lru_list lru)
{ {
if (is_file_lru(lru)) if (is_file_lru(lru))
return inactive_file_is_low(lruvec); return inactive_file_is_low(lruvec);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment