[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200612302340.57337.vda.linux@googlemail.com>
Date: Sat, 30 Dec 2006 23:40:57 +0100
From: Denis Vlasenko <vda.linux@...glemail.com>
To: "Robert P. J. Day" <rpjday@...dspring.com>
Cc: Linux kernel mailing list <linux-kernel@...r.kernel.org>,
Andi Kleen <ak@...e.de>
Subject: Re: replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"?
On Saturday 30 December 2006 23:08, Robert P. J. Day wrote:
> >
> > clear_page assumes that given address is page aligned, I think. It
> > may fail if you feed it with misaligned region's address.
>
> i don't see how that can be true, given that most of the definitions
> of the clear_page() macro are simply invocations of memset(). see for
> yourself:
>
> $ grep -r "#define clear_page" include
>
> my only point here was that lots of code seems to be calling memset()
> when it would be clearer to invoke clear_page(). but there's still
> something a bit curious happening here. i'll poke around a bit more
> before i ask, though.
There are MMX implementations of clear_page().
I was experimenting with SSE[2] clear_page() which uses
non-temporal stores. That one requires 16 byte alignment.
BTW, it worked ~300% faster than memset. But Andi Kleen
insists that cache eviction caused by NT stores will make it
slower in macrobenchmark.
Apart from fairly extensive set of microbechmarks
I tested kernel compiles (i.e. "real world load")
and they are FASTER too, not slower, but Andi
is fairly entrenched in his opinion ;)
I gave up.
--
vda
-
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