public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [TRIVIAL] kstrdup
Date: 18 Apr 2003 12:24:09 -0700	[thread overview]
Message-ID: <b7pjcp$j8h$1@cesium.transmeta.com> (raw)
In-Reply-To: 3EA0469D.7090602@pobox.com

Followup to:  <3EA0469D.7090602@pobox.com>
By author:    Jeff Garzik <jgarzik@pobox.com>
In newsgroup: linux.dev.kernel
> 
> That's kinda cute.  Why not submit a patch to the strcpy implementation 
> in include/asm-i386/string.h?  :)  Ours is shorter, but does have a jump:
>          "1:\tlodsb\n\t"
>          "stosb\n\t"
>          "testb %%al,%%al\n\t"
>          "jne 1b"
> 
> Which is better?  I don't know; I'm still learning the performance 
> eccentricities of x86 insns on various processors.
> 

It varies from porocessor to processor, and also depends on usage.

> 
> Related x86 question:  if the memory buffer is not dword-aligned, is 
> 'rep movsl' the best idea?  On RISC it's usually smarter to unroll the 
> head of the loop to avoid unaligned accesses; but from reading x86 asm 
> code in the kernel, nobody seems to care about that.  Is the 
> unaligned-access penalty so small that the increased code size of the 
> head-unroll is never worth it?
> 

A lot of the newer x86 processors will perform this unrolling in
microcode.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64

  reply	other threads:[~2003-04-18 19:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-18  7:58 [TRIVIAL] kstrdup Rusty Trivial Russell
2003-04-18  8:10 ` Jeff Garzik
2003-04-18 16:20   ` Linus Torvalds
2003-04-18 16:56     ` Jeff Garzik
2003-04-18 18:00       ` Linus Torvalds
2003-04-18 18:44         ` Jeff Garzik
2003-04-19  4:52         ` Rusty Russell
2003-04-18 18:00       ` Richard B. Johnson
2003-04-18 18:40         ` Jeff Garzik
2003-04-18 19:24           ` H. Peter Anvin [this message]
2003-04-18 23:37             ` Alan Cox
2003-04-18 19:29           ` Richard B. Johnson
2003-04-19 11:45             ` Kai Henningsen
2003-04-19 20:16             ` Ruth Ivimey-Cook
2003-04-19  4:14   ` Rusty Russell
2003-04-19  4:48     ` Jeff Garzik
2003-04-19  8:28       ` Rusty Russell
2003-04-19 12:27       ` Alan Cox
2003-04-19 14:44         ` Bernd Eckenfels
2003-04-20  8:05         ` Rusty Russell

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='b7pjcp$j8h$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --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