public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alexey Dobriyan <adobriyan@gmail.com>, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH] smaller strlen()
Date: Fri, 26 Aug 2016 15:23:21 -0700	[thread overview]
Message-ID: <1472250201.4914.88.camel@perches.com> (raw)
In-Reply-To: <20160826200120.GA1852@p183.telecom.by>

On Fri, 2016-08-26 at 23:01 +0300, Alexey Dobriyan wrote:
> gcc prefers "*s++" style code for some reason, doesn't unroll loop
> condition check once. Kernel strings are small but they aren't of 0
> length, so that additional branch was almost never taken.

Hey Alexey.

Is this gcc version specific?

And I'm confused why there isn't an asm __HAVE_ARCH_STRLEN
version x86_64 strlen like x86_32 or if __builtin_strlen()
is or isn't used.  Maybe Andi Kleen knows/remembers (cc'd).

> 	$ ./scripts/bloat-o-meter ../vmlinux-000 ../obj/vmlinux
> 	strlen         30      26      -4
> 	strlcpy        71      64      -7
> 	strlcat       120      99     -21
> 
> strlcpy() and strlcat() are collateral damage :^)

      reply	other threads:[~2016-08-26 22:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-26 20:01 [PATCH] smaller strlen() Alexey Dobriyan
2016-08-26 22:23 ` Joe Perches [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=1472250201.4914.88.camel@perches.com \
    --to=joe@perches.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    /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