On 3/30/19 11:04 AM, Konstantin Khorenko wrote:
> From: Andrey Ryabinin <aryabi...@virtuozzo.com>
> 
> At the moment inactive_list_is_low() mistakenly checks FILE list
> whatever (file or anon) list is asked to check.
> 
> Honor list type argument.
> 
> Fixes: 1f45c6c57160 ("mm/vmscan: active lru protection fixups.")
> https://jira.sw.ru/browse/PSBM-92480
> 

Fixes: bd24af0d6d08052165b43883213f564833de06e5 ("ms/mm: workingset: per-cgroup 
cache thrash detection")



> Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
> Acked-by: Konstantin Khorenko <khore...@virtuozzo.com>
> ---
>  mm/vmscan.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 1f5f48dd3cf1..74d3e8c61cf7 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2008,7 +2008,9 @@ static void shrink_active_list(unsigned long nr_to_scan,
>  static int inactive_list_is_low(struct lruvec *lruvec, bool file,
>                               struct mem_cgroup *memcg, bool actual_reclaim)
>  {
> +     enum lru_list active_lru = file * LRU_FILE + LRU_ACTIVE;
>       struct zone *zone = lruvec_zone(lruvec);
> +     enum lru_list inactive_lru = file * LRU_FILE;
>       unsigned long inactive_ratio;
>       unsigned long inactive;
>       unsigned long active;
> @@ -2022,8 +2024,8 @@ static int inactive_list_is_low(struct lruvec *lruvec, 
> bool file,
>       if (!file && !total_swap_pages)
>               return false;
>  
> -     inactive = lruvec_lru_size(lruvec, LRU_INACTIVE_FILE);
> -     active = lruvec_lru_size(lruvec, LRU_ACTIVE_FILE);
> +     inactive = lruvec_lru_size(lruvec, inactive_lru);
> +     active = lruvec_lru_size(lruvec, active_lru);
>  
>       if (memcg)
>               refaults = memcg_ws_activates(memcg);
> 
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to