From: Michal Hocko <mhocko@kernel.org>
To: zbestahu <zbestahu@aliyun.com>
Cc: akpm <akpm@linux-foundation.org>, minchan <minchan@kernel.org>,
linux-mm <linux-mm@kvack.org>, Yue Hu <huyue2@coolpad.com>,
Anton Vorontsov <anton.vorontsov@linaro.org>
Subject: Re: Re:[PATCH] mm: vmpressure: simplify pressure ratio calculation
Date: Tue, 4 Jul 2017 15:54:31 +0200 [thread overview]
Message-ID: <20170704135431.GS14722@dhcp22.suse.cz> (raw)
In-Reply-To: <91b685c4-acee-4ecd-9176-ab95a7172cac.zbestahu@aliyun.com>
On Tue 04-07-17 21:43:39, zbestahu wrote:
> Michal wrote:
> > > the existing percent
> > > calculation using scale should be about rounding to intege, it
> > > seems to be redundant, we can calculate it directly just like
> > > "pressure = not_relaimed * 100 / scanned", no rounding issue. And
> > > it's also better because of saving several arithmetic operations.
>
> > and you haven't explained why that change is so much better to change
> > the behavior.
>
> it removes 3 below arithmetic instructions so it should be running faster.
> add: scanned + reclaimed
> mul: scale * reclaimed
> udiv: reclaimed * scale /scanned
That part is clear from the diff... What is not clear from the diff is
your motivation. This path is not hot (we are in the reclaim which is a
slow path) and few extra instructions are acceptable. Sure we can
optimize it if the resulting code is working as expected. What I am
asking (obviously unsuccessfully) is to describe _why_ it is better.
This is a requirement for _each patch_. We are not changing the code
"just because I like it more that way".
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-07-04 13:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 13:43 zbestahu
2017-07-04 13:54 ` Michal Hocko [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-07-04 12:59 zbestahu
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=20170704135431.GS14722@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=anton.vorontsov@linaro.org \
--cc=huyue2@coolpad.com \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=zbestahu@aliyun.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