mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Michal Hocko <mhocko@suse.com>
Cc: linux-kernel@vger.kernel.org, hannes@cmpxchg.org,
	mm-commits@vger.kernel.org, zhongjiang-ali@linux.alibaba.com
Subject: Re: + mm-memcontrol-correct-the-nr_anon_thps-counter-of-hierarchical-memcg-fix.patch added to -mm tree
Date: Wed, 28 Oct 2020 16:24:53 -0700	[thread overview]
Message-ID: <20201028162453.530ab33e20b3722a367b8b9a@linux-foundation.org> (raw)
In-Reply-To: <20201027072157.GO20500@dhcp22.suse.cz>

On Tue, 27 Oct 2020 08:21:57 +0100 Michal Hocko <mhocko@suse.com> wrote:

> > --- 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.

Sure..

--- a/mm/memcontrol.c~mm-memcontrol-correct-the-nr_anon_thps-counter-of-hierarchical-memcg-fix-fix
+++ a/mm/memcontrol.c
@@ -4119,8 +4119,8 @@ 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 %lu\n", memcg1_stat_names[i],
-						nr * PAGE_SIZE);
+		seq_printf(m, "total_%s %llu\n", memcg1_stat_names[i],
+						(u64)nr * PAGE_SIZE);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(memcg1_events); i++)
_


      reply	other threads:[~2020-10-28 23:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201026210801.n9JtTzchy%akpm@linux-foundation.org>
2020-10-27  7:21 ` Michal Hocko
2020-10-28 23:24   ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201028162453.530ab33e20b3722a367b8b9a@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=zhongjiang-ali@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®