From mboxrd@z Thu Jan 1 00:00:00 1970 From: kosaki.motohiro@jp.fujitsu.com (KOSAKI Motohiro) Date: Wed, 4 Feb 2009 13:34:46 +0900 (JST) Subject: [ltt-dev] [PATCH] LTTng optimize write to page function In-Reply-To: <20090203171033.GA19461@Krystal> References: <20090203171033.GA19461@Krystal> Message-ID: <20090204132458.ECC0.KOSAKI.MOTOHIRO@jp.fujitsu.com> 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?