From: "Robert P. J. Day" <rpjday@mindspring.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Denis Vlasenko <vda.linux@googlemail.com>,
Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"?
Date: Sat, 30 Dec 2006 18:04:14 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.64.0612301750550.16519@localhost.localdomain> (raw)
In-Reply-To: <1167518748.20929.578.camel@laptopd505.fenrus.org>
On Sat, 30 Dec 2006, Arjan van de Ven wrote:
> rday wrote:
> > ... most of the definitions of the clear_page() macro are simply
> > invocations of memset(). see for yourself:
> *MOST*. Not all.
i did notice that. while the majority of the architectures simply
define clear_page() as a macro calling memset(ptr, 0, PAGE_SIZE), the
rest will implement it in assembler code for whatever reason. (i'm
assuming that *every* architecture *must* define clear_page() one way
or the other, is that correct? that would seem fairly obvious, but
i just want to make sure i'm not missing anything obvious.)
> clear_page() is supposed to be for full real pages only... for
> example it allows the architecture to optimize for alignment, cache
> aliasing etc etc.
fair enough. *technically*, not every call of the form
"memset(ptr,0,PAGE_SIZE)" necessarily represents an address that's on
a page boundary. but, *realistically*, i'm guessing most of them do.
just grabbing a random example from some grep output:
arch/sh/mm/init.c:
...
/* clear the zero-page */
memset(empty_zero_page, 0, PAGE_SIZE);
...
my only point here is that, given that every architecture needs to
supply some kind of definition of a "clear_page()" routine, one would
think that *lots* of those memset() calls could reasonably be
rewritten as a clear_page() call for improved readibility, no?
and there are a *lot* of memset() calls like that.
rday
next prev parent reply other threads:[~2006-12-30 23:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-29 6:16 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
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 [this message]
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=Pine.LNX.4.64.0612301750550.16519@localhost.localdomain \
--to=rpjday@mindspring.com \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vda.linux@googlemail.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
all inboxes | Powered by JetHome®