fs/inode: Make too_many_isolated return bool

Message ID 20240205022825.99061-1-gehao@kylinos.cn
State New
Headers
Series fs/inode: Make too_many_isolated return bool |

Commit Message

Hao Ge Feb. 5, 2024, 2:28 a.m. UTC
  too_many_isolated should return bool which with the same name and
similar functions in mm/compaction.c already returned bool

Signed-off-by: Hao Ge <gehao@kylinos.cn>
---
 mm/vmscan.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Hao Ge Feb. 5, 2024, 4:23 a.m. UTC | #1
Sorry, please ignore this patch due to an incorrect title. I will resend the correct one

> On Feb 5, 2024, at 10:28, Hao Ge <gehao@kylinos.cn> wrote:
> 
> too_many_isolated should return bool which with the same name and
> similar functions in mm/compaction.c already returned bool
> 
> Signed-off-by: Hao Ge <gehao@kylinos.cn>
> ---
> mm/vmscan.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 4f9c854ce6cc..143e4b8e8821 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1744,17 +1744,17 @@ bool folio_isolate_lru(struct folio *folio)
>  * the LRU list will go small and be scanned faster than necessary, leading to
>  * unnecessary swapping, thrashing and OOM.
>  */
> -static int too_many_isolated(struct pglist_data *pgdat, int file,
> +static bool too_many_isolated(struct pglist_data *pgdat, int file,
>        struct scan_control *sc)
> {
>    unsigned long inactive, isolated;
>    bool too_many;
> 
>    if (current_is_kswapd())
> -        return 0;
> +        return false;
> 
>    if (!writeback_throttling_sane(sc))
> -        return 0;
> +        return false;
> 
>    if (file) {
>        inactive = node_page_state(pgdat, NR_INACTIVE_FILE);
> --
> 2.25.1
  

Patch

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 4f9c854ce6cc..143e4b8e8821 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1744,17 +1744,17 @@  bool folio_isolate_lru(struct folio *folio)
  * the LRU list will go small and be scanned faster than necessary, leading to
  * unnecessary swapping, thrashing and OOM.
  */
-static int too_many_isolated(struct pglist_data *pgdat, int file,
+static bool too_many_isolated(struct pglist_data *pgdat, int file,
 		struct scan_control *sc)
 {
 	unsigned long inactive, isolated;
 	bool too_many;
 
 	if (current_is_kswapd())
-		return 0;
+		return false;
 
 	if (!writeback_throttling_sane(sc))
-		return 0;
+		return false;
 
 	if (file) {
 		inactive = node_page_state(pgdat, NR_INACTIVE_FILE);