From: Denis Vlasenko <vda.linux@googlemail.com>
To: "Robert P. J. Day" <rpjday@mindspring.com>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@suse.de>
Subject: Re: replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"?
Date: Sat, 30 Dec 2006 23:40:57 +0100 [thread overview]
Message-ID: <200612302340.57337.vda.linux@googlemail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0612301705250.16056@localhost.localdomain>
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
next prev parent reply other threads:[~2006-12-30 22:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-29 6:16 replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"? Robert P. J. Day
2006-12-30 20:49 ` Denis Vlasenko
2006-12-30 22:08 ` Robert P. J. Day
2006-12-30 22:40 ` Denis Vlasenko [this message]
2007-01-03 6:23 ` dean gaudet
2006-12-30 22:45 ` Arjan van de Ven
2006-12-30 23:04 ` Robert P. J. Day
2006-12-31 18:39 ` Paul Mundt
2006-12-31 19:04 ` Robert P. J. Day
2007-01-01 1:59 ` Folkert van Heusden
2007-01-01 8:33 ` Robert P. J. Day
2007-01-01 10:14 ` Arjan van de Ven
2007-01-01 10:27 ` Robert P. J. Day
2007-01-01 19:05 ` Dave Jones
2007-01-01 8:42 ` Paul Mundt
2007-01-01 17:09 ` Randy Dunlap
2006-12-31 13:39 ` Folkert van Heusden
2006-12-31 13:45 ` Arjan van de Ven
2006-12-31 16:39 ` Robert P. J. Day
2006-12-31 17:43 ` Arjan van de Ven
2007-01-03 13:20 ` Robert P. J. Day
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=200612302340.57337.vda.linux@googlemail.com \
--to=vda.linux@googlemail.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rpjday@mindspring.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