Messages in this thread | | | Date | Sat, 30 Dec 2006 18:04:14 -0500 (EST) | From | "Robert P. J. Day" <> | Subject | Re: replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"? |
| |
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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |