This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH RFC] Improve 64bit memset for Corei7 with avx2 instruction


On Thu, Aug 01, 2013 at 08:32:36AM -0700, H.J. Lu wrote:
> On Tue, Jul 30, 2013 at 5:38 AM, Ling Ma <ling.ma.program@gmail.com> wrote:
> > 2013/7/30, OndÅej BÃlka <neleai@seznam.cz>:
> >> On Tue, Jul 30, 2013 at 05:26:09PM +0800, Ling Ma wrote:
> >>> We never find prefetcht1 is good instruction to pre-fetch data on
> >>> core2, nehalem, sandybridge, and haswell. Our experiments  show
> >>> prefetchw is best in your cases.
> >>
>
And
 
> There is no need to test prefetchw on Haswll since it isn't
> supported. I think this is a rare case where prefetcht0 helps.
> 
This was testcase about prefetch being harmul. A benchmark code was:

memset2(ary+4096-512+(4096*((unsigned)rand_r(&seed)))%SIZE,0,512);

We memset only last 512 bytes in pages. With prefetching also first 512
bytes from pages will be fetched. This will double cache usage and
degrade performance.
Of course when prefetchw is not supported it will help.

> 
> --
> H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]