From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933310AbcAYVWR (ORCPT ); Mon, 25 Jan 2016 16:22:17 -0500 Received: from mail113-251.mail.alibaba.com ([205.204.113.251]:50623 "EHLO us-alimail-mta1.hst.scl.en.alidc.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933015AbcAYVWN (ORCPT ); Mon, 25 Jan 2016 16:22:13 -0500 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09991899|-1;FP=0|0|0|0|0|-1|-1|-1;HT=e01l10435;MF=chengang@emindsoft.com.cn;NM=1;PH=DS;RN=6;RT=6;SR=0;TI=SMTPD_----4U2K8Gs_1453756884; Message-ID: <56A692AA.20902@emindsoft.com.cn> Date: Tue, 26 Jan 2016 05:24:58 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Al Viro CC: dhowells@redhat.com, akpm@linux-foundation.org, nicolas.iooss_linux@m4x.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] fs: dcache: Use bool return value instead of int References: <1452547845-12039-1-git-send-email-chengang@emindsoft.com.cn> <20160111225104.GO17997@ZenIV.linux.org.uk> <5695733C.1010201@emindsoft.com.cn> <20160112222105.GT17997@ZenIV.linux.org.uk> <5696D239.2000605@emindsoft.com.cn> <20160113225446.GU17997@ZenIV.linux.org.uk> <5697C139.7040709@emindsoft.com.cn> <56A53FEF.6020803@emindsoft.com.cn> <20160124212728.GA17997@ZenIV.linux.org.uk> In-Reply-To: <20160124212728.GA17997@ZenIV.linux.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/25/16 05:27, Al Viro wrote: > > Again, do you have _any_ evidence of improved code generation with that > patch? Because if you do, I would really like to see it, so I could file > bugs against gcc optimizer. > > Your impression of what _Bool is and what semantics does it have appears > to be rather different from that described in C99, but that's a secondary > issue - first and foremost, on which .config and with which gcc version > do you see improvements from that change? > For our case, the check_mount function have smaller size under x86_64 (movl for int, movb for bool, movl is longer than movb). The related objdump is below, welcome any ideas, suggestions, and discussions for it. origin (for int): 00000000 : 0: 8b 12 mov (%edx),%edx 2: 81 e2 00 00 01 00 and $0x10000,%edx 8: 74 16 je 20 a: c7 00 01 00 00 00 movl $0x1,(%eax) 10: b8 01 00 00 00 mov $0x1,%eax 15: c3 ret 16: 8d 76 00 lea 0x0(%esi),%esi 19: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 20: 31 c0 xor %eax,%eax 22: c3 ret 23: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi new (for bool): 00000000 : 0: 8b 12 mov (%edx),%edx 2: 81 e2 00 00 01 00 and $0x10000,%edx 8: 74 0e je 18 a: c6 00 01 movb $0x1,(%eax) d: b8 01 00 00 00 mov $0x1,%eax 12: c3 ret 13: 90 nop 14: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 18: 31 c0 xor %eax,%eax 1a: c3 ret 1b: 90 nop 1c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi [root@localhost fs]# gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-ana/configure Thread model: posix gcc version 6.0.0 20151121 (experimental) (GCC) -- Chen Gang (陈刚) Open, share, and attitude like air, water, and life which God blessed