Re: [PATCH v4 1/7] mm: memcontrol: fix NR_ANON_THPS accounting in charge moving

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> The unit of NR_ANON_THPS is HPAGE_PMD_NR already. So it should inc/dec
> by one rather than nr_pages.
>
> Fixes: 468c398233da ("mm: memcontrol: switch to native NR_ANON_THPS counter")
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>
> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>
> Reviewed-by: Roman Gushchin <guro@xxxxxx>
> ---
>  mm/memcontrol.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index b80328f52fb4..8818bf64d6fe 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -5653,10 +5653,8 @@ static int mem_cgroup_move_account(struct page *page,
>                         __mod_lruvec_state(from_vec, NR_ANON_MAPPED, -nr_pages);
>                         __mod_lruvec_state(to_vec, NR_ANON_MAPPED, nr_pages);
>                         if (PageTransHuge(page)) {
> -                               __mod_lruvec_state(from_vec, NR_ANON_THPS,
> -                                                  -nr_pages);
> -                               __mod_lruvec_state(to_vec, NR_ANON_THPS,
> -                                                  nr_pages);
> +                               __dec_lruvec_state(from_vec, NR_ANON_THPS);
> +                               __inc_lruvec_state(to_vec, NR_ANON_THPS);
>                         }
>
>                 }

Acked-by: Pankaj Gupta <pankaj.gupta@xxxxxxxxxxxxxxx>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux