From: kosaki.motohiro@jp.fujitsu.com (KOSAKI Motohiro)
Subject: [ltt-dev] [PATCH] LTTng optimize write to page function
Date: Wed, 4 Feb 2009 13:34:46 +0900 (JST) [thread overview]
Message-ID: <20090204132458.ECC0.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20090203171033.GA19461@Krystal>
Hi
> +static inline void ltt_relay_do_copy(void *dest, const void *src, size_t len)
> +{
> + switch (len) {
> + case 1: *(u8 *)dest = *(const u8 *)src;
> + break;
> + case 2: *(u16 *)dest = *(const u16 *)src;
> + break;
> + case 4: *(u32 *)dest = *(const u32 *)src;
> + break;
> +#if (BITS_PER_LONG == 64)
> + case 8: *(u64 *)dest = *(const u64 *)src;
> + break;
> +#endif
> + default:
> + memcpy(dest, src, len);
> + }
> +}
hm, interesting.
IIRC, few month ago, linus said this optimization is not optimazation.
lastest gcc does this inlining automatically.
(but I can't point its url, sorry)
Is this result gcc version independent? and can you send
the difference of gcc assembly outout?
next prev parent reply other threads:[~2009-02-04 4:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-03 17:10 Mathieu Desnoyers
2009-02-03 17:47 ` [ltt-dev] [PATCH] LTTng optimize write to page function (v2) Mathieu Desnoyers
2009-02-04 1:12 ` [ltt-dev] [PATCH] LTTng optimize write to page function Lai Jiangshan
2009-02-04 2:35 ` Mathieu Desnoyers
2009-02-04 3:53 ` Mathieu Desnoyers
2009-02-04 4:07 ` Zhaolei
2009-02-04 4:53 ` Mathieu Desnoyers
2009-02-04 4:34 ` KOSAKI Motohiro [this message]
2009-02-04 5:44 ` Mathieu Desnoyers
2009-02-04 8:09 ` KOSAKI Motohiro
2009-02-04 17:54 ` Mathieu Desnoyers
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=20090204132458.ECC0.KOSAKI.MOTOHIRO@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.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: 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