Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752391AbbH3Vr0 (ORCPT ); Sun, 30 Aug 2015 17:47:26 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:33867 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbbH3VrY (ORCPT ); Sun, 30 Aug 2015 17:47:24 -0400 From: Rasmus Villemoes To: Yury Cc: Alexey Klimov , Cassidy Burden , Andrew Morton , linux-arm-msm@vger.kernel.org, Linux Kernel Mailing List , linux-arm-kernel@lists.infradead.org, "David S. Miller" , Daniel Borkmann , Hannes Frederic Sowa , Lai Jiangshan , Mark Salter , AKASHI Takahiro , Thomas Graf , Valentin Rothberg , Chris Wilson , linux@horizon.com Subject: Re: [PATCH] lib: Make _find_next_bit helper function inline Organization: D03 References: <1438110564-19932-1-git-send-email-cburden@codeaurora.org> <55B7F2C6.9010000@gmail.com> <20150728144537.67d46b5714c99d25f0bb33fb@linux-foundation.org> <1438176656.18723.8.camel@ceres> <55B93A47.90107@codeaurora.org> <55E1CC83.1010007@gmail.com> X-Hashcash: 1:20:150830:yury.norov@gmail.com::ytcPrT/8AUjkmK8o:0000000000000000000000000000000000000000006Nw X-Hashcash: 1:20:150830:linux-arm-msm@vger.kernel.org::qmTxOkjbmomnrhZa:000000000000000000000000000000000WdA X-Hashcash: 1:20:150830:chris@chris-wilson.co.uk::Zul21h4TjCAI1gr1:00000000000000000000000000000000000000V+2 X-Hashcash: 1:20:150830:dborkman@redhat.com::92H4Ijpq2+pVHYFU:0000000000000000000000000000000000000000000q3X X-Hashcash: 1:20:150830:laijs@cn.fujitsu.com::DRFGGJTSU8bepASb:000000000000000000000000000000000000000000+Wf X-Hashcash: 1:20:150830:akpm@linux-foundation.org::rD17J+BW7rWiwKhN:000000000000000000000000000000000000183z X-Hashcash: 1:20:150830:valentinrothberg@gmail.com::mQmXrpEVRe8mclh9:000000000000000000000000000000000001JHQ X-Hashcash: 1:20:150830:linux-arm-kernel@lists.infradead.org::pTkYylnEKU6FhGue:00000000000000000000000001bFt X-Hashcash: 1:20:150830:linux@horizon.com::P4EILjxQl8xzxXwV:000000000000000000000000000000000000000000002ZjZ X-Hashcash: 1:20:150830:klimov.linux@gmail.com::+NUucRacwq8HW/3M:0000000000000000000000000000000000000003WhK X-Hashcash: 1:20:150830:davem@davemloft.net::4MkzjuS5Xv8xIMag:0000000000000000000000000000000000000000004JiV X-Hashcash: 1:20:150830:cburden@codeaurora.org::PGLOdxarvwHBmqSH:00000000000000000000000000000000000000087ar X-Hashcash: 1:20:150830:linux-kernel@vger.kernel.org::BuD7bDJl1G5u6c9i:0000000000000000000000000000000009itd X-Hashcash: 1:20:150830:tgraf@suug.ch::Laev4qVg76HuXXG9:0000A6pd X-Hashcash: 1:20:150830:takahiro.akashi@linaro.org::/qf6JxFkqaHeB6hO:00000000000000000000000000000000000CFX9 X-Hashcash: 1:20:150830:hannes@stressinduktion.org::uUCKKNIjRa3QrjA5:00000000000000000000000000000000000IXct X-Hashcash: 1:20:150830:msalter@redhat.com::3uTlpHleuKpL0oK5:0000000000000000000000000000000000000000000L5fP Date: Sun, 30 Aug 2015 23:47:20 +0200 In-Reply-To: <55E1CC83.1010007@gmail.com> (Yury's message of "Sat, 29 Aug 2015 18:15:15 +0300") Message-ID: <87si701maf.fsf@rasmusvillemoes.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 795 Lines: 15 I've lost track of what's up and down in this, but now that I look at this again let me throw in my two observations of stupid gcc behaviour: For the current code, both debian's gcc (4.7) and 5.1 partially inlines _find_next_bit, namely the "if (!nbits || start >= nbits)" test. I know it does it to avoid a function call, but in this case the early return condition is unlikely, so there's not much to gain. Moreover, it fails to optimize the test to simply "if (start >= nbits)" - everything being unsigned, these are obviously equivalent. Rasmus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/