From: Rasmus Villemoes <linux@rasmusvillemoes.dk> To: Yury <yury.norov@gmail.com> Cc: Alexey Klimov <klimov.linux@gmail.com>, Cassidy Burden <cburden@codeaurora.org>, Andrew Morton <akpm@linux-foundation.org>, linux-arm-msm@vger.kernel.org, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, linux-arm-kernel@lists.infradead.org, "David S. Miller" <davem@davemloft.net>, Daniel Borkmann <dborkman@redhat.com>, Hannes Frederic Sowa <hannes@stressinduktion.org>, Lai Jiangshan <laijs@cn.fujitsu.com>, Mark Salter <msalter@redhat.com>, AKASHI Takahiro <takahiro.akashi@linaro.org>, Thomas Graf <tgraf@suug.ch>, Valentin Rothberg <valentinrothberg@gmail.com>, Chris Wilson <chris@chris-wilson.co.uk>, linux@horizon.com Subject: Re: [PATCH] lib: Make _find_next_bit helper function inline Date: Sun, 30 Aug 2015 23:47:20 +0200 [thread overview] Message-ID: <87si701maf.fsf@rasmusvillemoes.dk> (raw) In-Reply-To: <55E1CC83.1010007@gmail.com> (Yury's message of "Sat, 29 Aug 2015 18:15:15 +0300") 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
WARNING: multiple messages have this Message-ID (diff)
From: linux@rasmusvillemoes.dk (Rasmus Villemoes) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] lib: Make _find_next_bit helper function inline Date: Sun, 30 Aug 2015 23:47:20 +0200 [thread overview] Message-ID: <87si701maf.fsf@rasmusvillemoes.dk> (raw) In-Reply-To: <55E1CC83.1010007@gmail.com> (Yury's message of "Sat, 29 Aug 2015 18:15:15 +0300") 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
next prev parent reply other threads:[~2015-08-30 21:47 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-07-28 19:09 [PATCH] lib: Make _find_next_bit helper function inline Cassidy Burden 2015-07-28 19:09 ` Cassidy Burden 2015-07-28 21:23 ` Yury 2015-07-28 21:23 ` Yury 2015-07-28 21:38 ` Yury 2015-07-28 21:38 ` Yury 2015-07-28 21:45 ` Andrew Morton 2015-07-28 21:45 ` Andrew Morton 2015-07-29 13:30 ` Alexey Klimov 2015-07-29 13:30 ` Alexey Klimov 2015-07-29 20:40 ` Cassidy Burden 2015-07-29 20:40 ` Cassidy Burden 2015-08-23 22:53 ` Alexey Klimov 2015-08-23 22:53 ` Alexey Klimov 2015-08-29 15:15 ` Yury 2015-08-29 15:15 ` Yury 2015-08-30 21:47 ` Rasmus Villemoes [this message] 2015-08-30 21:47 ` Rasmus Villemoes
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=87si701maf.fsf@rasmusvillemoes.dk \ --to=linux@rasmusvillemoes.dk \ --cc=akpm@linux-foundation.org \ --cc=cburden@codeaurora.org \ --cc=chris@chris-wilson.co.uk \ --cc=davem@davemloft.net \ --cc=dborkman@redhat.com \ --cc=hannes@stressinduktion.org \ --cc=klimov.linux@gmail.com \ --cc=laijs@cn.fujitsu.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux@horizon.com \ --cc=msalter@redhat.com \ --cc=takahiro.akashi@linaro.org \ --cc=tgraf@suug.ch \ --cc=valentinrothberg@gmail.com \ --cc=yury.norov@gmail.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.