From: Andrew Morton <akpm@linux-foundation.org>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Randy Dunlap <rdunlap@infradead.org>,
broonie@kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-next@vger.kernel.org, mhocko@suse.cz,
mm-commits@vger.kernel.org, sfr@canb.auug.org.au,
Chris Down <chris@chrisdown.name>
Subject: Re: mmotm 2019-07-24-21-39 uploaded (mm/memcontrol)
Date: Fri, 26 Jul 2019 21:19:52 -0700 [thread overview]
Message-ID: <20190726211952.757a63db5271d516faa7eaac@linux-foundation.org> (raw)
In-Reply-To: <20190727034205.GA10843@archlinux-threadripper>
On Fri, 26 Jul 2019 20:42:05 -0700 Nathan Chancellor <natechancellor@gmail.com> wrote:
> > @@ -2414,8 +2414,9 @@ void mem_cgroup_handle_over_high(void)
> > */
> > clamped_high = max(high, 1UL);
> >
> > - overage = ((u64)(usage - high) << MEMCG_DELAY_PRECISION_SHIFT)
> > - / clamped_high;
> > + overage = (u64)(usage - high) << MEMCG_DELAY_PRECISION_SHIFT;
> > + do_div(overage, clamped_high);
> > +
> > penalty_jiffies = ((u64)overage * overage * HZ)
> > >> (MEMCG_DELAY_PRECISION_SHIFT + MEMCG_DELAY_SCALING_SHIFT);
> >
> > _
> >
>
> This causes a build error on arm:
>
Ah.
It's rather unclear why that u64 cast is there anyway. We're dealing
with ulongs all over this code. The below will suffice.
Chris, please take a look?
--- a/mm/memcontrol.c~mm-throttle-allocators-when-failing-reclaim-over-memoryhigh-fix-fix-fix
+++ a/mm/memcontrol.c
@@ -2415,7 +2415,7 @@ void mem_cgroup_handle_over_high(void)
clamped_high = max(high, 1UL);
overage = (u64)(usage - high) << MEMCG_DELAY_PRECISION_SHIFT;
- do_div(overage, clamped_high);
+ overage /= clamped_high;
penalty_jiffies = ((u64)overage * overage * HZ)
>> (MEMCG_DELAY_PRECISION_SHIFT + MEMCG_DELAY_SCALING_SHIFT);
_
next prev parent reply other threads:[~2019-07-27 4:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 4:40 mmotm 2019-07-24-21-39 uploaded akpm
2019-07-25 22:02 ` mmotm 2019-07-24-21-39 uploaded (mm/memcontrol) Randy Dunlap
2019-07-25 23:39 ` Andrew Morton
2019-07-25 23:51 ` Randy Dunlap
2019-07-27 3:42 ` Nathan Chancellor
2019-07-27 4:19 ` Andrew Morton [this message]
2019-07-27 4:36 ` Nathan Chancellor
2019-07-27 10:16 ` Chris Down
2019-07-28 23:51 ` Stephen Rothwell
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=20190726211952.757a63db5271d516faa7eaac@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=chris@chrisdown.name \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-next@vger.kernel.org \
--cc=mhocko@suse.cz \
--cc=mm-commits@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=rdunlap@infradead.org \
--cc=sfr@canb.auug.org.au \
/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