diff mbox series

mm/vmscan.c: use update_lru_size() in update_lru_sizes()

Message ID 20200331221550.1011-1-richard.weiyang@gmail.com (mailing list archive)
State New, archived
Headers show
Series mm/vmscan.c: use update_lru_size() in update_lru_sizes() | expand

Commit Message

Wei Yang March 31, 2020, 10:15 p.m. UTC
We already defined the helper update_lru_size().

Let's use this to reduce code duplication.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/vmscan.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Baoquan He April 1, 2020, 1:39 a.m. UTC | #1
On 03/31/20 at 10:15pm, Wei Yang wrote:
> We already defined the helper update_lru_size().
> 
> Let's use this to reduce code duplication.
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> ---
>  mm/vmscan.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index f92858e5c2e3..a4fdf3dc8887 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1603,10 +1603,7 @@ static __always_inline void update_lru_sizes(struct lruvec *lruvec,
>  		if (!nr_zone_taken[zid])
>  			continue;
>  
> -		__update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
> -#ifdef CONFIG_MEMCG
> -		mem_cgroup_update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
> -#endif
> +		update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);

A nice clean up.

Reviewed-by: Baoquan He <bhe@redhat.com>

>  	}
>  
>  }
> -- 
> 2.23.0
> 
>
Michal Hocko April 1, 2020, 3:33 p.m. UTC | #2
On Tue 31-03-20 22:15:50, Wei Yang wrote:
> We already defined the helper update_lru_size().
> 
> Let's use this to reduce code duplication.
> 
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/vmscan.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index f92858e5c2e3..a4fdf3dc8887 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1603,10 +1603,7 @@ static __always_inline void update_lru_sizes(struct lruvec *lruvec,
>  		if (!nr_zone_taken[zid])
>  			continue;
>  
> -		__update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
> -#ifdef CONFIG_MEMCG
> -		mem_cgroup_update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
> -#endif
> +		update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
>  	}
>  
>  }
> -- 
> 2.23.0
>
diff mbox series

Patch

diff --git a/mm/vmscan.c b/mm/vmscan.c
index f92858e5c2e3..a4fdf3dc8887 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1603,10 +1603,7 @@  static __always_inline void update_lru_sizes(struct lruvec *lruvec,
 		if (!nr_zone_taken[zid])
 			continue;
 
-		__update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
-#ifdef CONFIG_MEMCG
-		mem_cgroup_update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
-#endif
+		update_lru_size(lruvec, lru, zid, -nr_zone_taken[zid]);
 	}
 
 }