From: 陈刚 <chengang@emindsoft.com.cn>
To: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>,
akpm <akpm@linux-foundation.org>, vbabka <vbabka@suse.cz>,
mgorman <mgorman@techsingularity.net>,
"gi-oh.kim" <gi-oh.kim@profitbricks.com>,
"iamjoonsoo.kim" <iamjoonsoo.kim@lge.com>,
"hillf.zj" <hillf.zj@alibaba-inc.com>,
rientjes <rientjes@google.com>, linux-mm <linux-mm@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Chen Gang <gang.chen.5i5j@gmail.com>
Subject: 回复:[PATCH] mm: migrate: Use bool instead of int for the return value of PageMovable
Date: Wed, 13 Jul 2016 22:26:08 +0800 [thread overview]
Message-ID: <ca2e145f-49fe-4032-aa66-2927f19a86ea.chengang@emindsoft.com.cn> (raw)
In-Reply-To: 20160713075346.GC28723@dhcp22.suse.cz
[-- Attachment #1: Type: text/plain, Size: 2537 bytes --]
Hello:
Excuse me, I have to over time work, and will not go back home until this week end.And I shall reply in this week end.
Thanks.
------------------------------------------------------------------发件人:Michal Hocko <mhocko@kernel.org>发送时间:2016年7月13日(星期三) 15:53收件人:陈刚 <chengang@emindsoft.com.cn>抄 送:Minchan Kim <minchan@kernel.org>; akpm <akpm@linux-foundation.org>; vbabka <vbabka@suse.cz>; mgorman <mgorman@techsingularity.net>; gi-oh.kim <gi-oh.kim@profitbricks.com>; iamjoonsoo.kim <iamjoonsoo.kim@lge.com>; hillf.zj <hillf.zj@alibaba-inc.com>; rientjes <rientjes@google.com>; linux-mm <linux-mm@kvack.org>; linux-kernel <linux-kernel@vger.kernel.org>; Chen Gang <gang.chen.5i5j@gmail.com>主 题:Re: [PATCH] mm: migrate: Use bool instead of int for the return value of PageMovable
On Wed 13-07-16 00:50:12, Chen Gang wrote:
>
>
> On 7/12/16 15:48, Michal Hocko wrote:
> > On Tue 12-07-16 03:47:42, Chen Gang wrote:
> > [...]
> >> In our case, the 2 output size are same, but under x86_64, the insns are
> >> different. After uses bool, it uses push/pop instead of branch, for me,
> >> it should be a little better for catching.
> >
> > The code generated for bool version looks much worse. Look at the fast
> > path. Gcc tries to reuse the retq from the fast path in the bool case
> > and so it has to push rbp and rbx on the stack.
> >
> > That being said, gcc doesn't seem to generate a better code for bool so
> > I do not think this is really worth it.
> >
>
> The code below also merge 3 statements into 1 return statement, although
> for me, it is a little more readable, it will generate a little bad code.
> That is the reason why the output looks a little bad.
>
> In our case, for gcc 6.0, using bool instead of int for bool function
> will get the same output under x86_64.
If the output is same then there is no reason to change it.
> In our case, for gcc 4.8, using bool instead of int for bool function
> will get a little better output under x86_64.
I had a different impression and the fast path code had more
instructions. But anyway, is there really a strong reason to change
those return values in the first place? Isn't that just a pointless code
churn?
--
Michal Hocko
SUSE Labs
[-- Attachment #2: Type: text/html, Size: 5879 bytes --]
prev parent reply other threads:[~2016-07-13 14:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-09 15:55 [PATCH] mm: migrate: Use bool instead of int for the return value of PageMovable chengang
2016-07-11 0:26 ` Minchan Kim
2016-07-11 19:47 ` Chen Gang
2016-07-12 7:15 ` Vlastimil Babka
2016-07-12 16:42 ` Chen Gang
2016-07-12 7:48 ` Michal Hocko
2016-07-12 16:50 ` Chen Gang
2016-07-13 7:53 ` Michal Hocko
2016-07-17 0:51 ` Chen Gang
2016-07-13 14:26 ` 陈刚 [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=ca2e145f-49fe-4032-aa66-2927f19a86ea.chengang@emindsoft.com.cn \
--to=chengang@emindsoft.com.cn \
--cc=akpm@linux-foundation.org \
--cc=gang.chen.5i5j@gmail.com \
--cc=gi-oh.kim@profitbricks.com \
--cc=hillf.zj@alibaba-inc.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=rientjes@google.com \
--cc=vbabka@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).