[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9317a84b59d0a78a4b8e304ac2da490a.squirrel@www.firstfloor.org>
Date: Wed, 18 May 2011 06:05:26 +0200
From: "Andi Kleen" <andi@...stfloor.org>
To: "Yu, Fenghua" <fenghua.yu@...el.com>
Cc: "Andi Kleen" <andi@...stfloor.org>, "Ingo Molnar" <mingo@...e.hu>,
"Thomas Gleixner" <tglx@...utronix.de>,
"H Peter Anvin" <hpa@...or.com>,
"Mallick, Asit K" <asit.k.mallick@...el.com>,
"Linus Torvalds" <torvalds@...ux-foundation.org>,
"Avi Kivity" <avi@...hat.com>,
"Arjan van de Ven" <arjan@...radead.org>,
"Andrew Morton" <akpm@...ux-foundation.org>,
"linux-kernel" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 9/9] x86/lib/memset_64.S: Optimize memset by enhanced REP
MOVSB/STOSB
>
> Only memcpy are generated by gcc when gcc version >=4.3. Other functions
> are defined by kernel lib.
Are you sure? AFAIK it supports more.
> I would leave gcc optimization for most memcpy cases instead of forcing
> memcpy to call the kernel lib memcpy. I hope gcc will catch up and
> implement a good enhanced rep movsb/stosb solution soon. If turns out gcc
> can not generate good memcpy, it's easy to switch to the patching kernel
> lib memcpy.
The problem is that gcc can only do that if you tell it to generate
code for that. But it has no mechanism to patch in/out different
variants for the same binary. So it would only work for a specially
optimized kernel for that CPU.
I suspect for smaller copies it won't make too much different anyways
and gcc's code is probably fine. But gcc won't know that you
can do better on large copies, so using a macro would be a way
to tell it that.
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists