lkml.org 
[lkml]   [2020]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + mm-memcontrol-correct-the-nr_anon_thps-counter-of-hierarchical-memcg-fix.patch added to -mm tree
On Mon 26-10-20 14:08:01, Andrew Morton wrote:
[...]
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm-memcontrol-correct-the-nr_anon_thps-counter-of-hierarchical-memcg-fix
>
> fix printk warning
>
> Cc: Johannes Weiner <hannes@cmpxchg.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: zhongjiang-ali <zhongjiang-ali@linux.alibaba.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> mm/memcontrol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/mm/memcontrol.c~mm-memcontrol-correct-the-nr_anon_thps-counter-of-hierarchical-memcg-fix
> +++ a/mm/memcontrol.c
> @@ -4107,7 +4107,7 @@ static int memcg_stat_show(struct seq_fi
> if (memcg1_stats[i] == NR_ANON_THPS)
> nr *= HPAGE_PMD_NR;
> #endif
> - seq_printf(m, "total_%s %llu\n", memcg1_stat_names[i],
> + seq_printf(m, "total_%s %lu\n", memcg1_stat_names[i],
> nr * PAGE_SIZE);

Shouldn't we cast to u64 instead? 32b systems with a lot of memory are
quite rare but going over 4G here is not something unimaginable. The
similar is true for other counters.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2020-10-27 08:22    [W:0.246 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site