All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Knutsson <ricknu-0@student.ltu.se>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] clear_page() and copy_page()
Date: Sun, 28 Jan 2007 17:41:41 +0000	[thread overview]
Message-ID: <45BCE055.7000508@student.ltu.se> (raw)
In-Reply-To: <Pine.LNX.4.64.0701280332020.29915@CPE00045a9c397f-CM001225dbafb6>

Robert P. J. Day wrote:
> On Sun, 28 Jan 2007, Richard Knutsson wrote:
>
>   
>> Robert P. J. Day wrote:
>>     
>>>   there are numerous instances of calls to memset() of the form
>>>
>>>   memset(<addr>, 0, PAGE_SIZE);
>>>
>>> to clear a single page, as you can see sprinkled throughout the output
>>> here (obviously, not every line of output represents one of those
>>> cases, the grep pattern is overly general):
>>>
>>>       
>> [snip]
>>     
>>> same questions here -- any issues with standardizing on calls to
>>> copy_page()?
>>>   rday
>>>
>>> p.s.  obviously, rewriting to use those simpler macros would imply
>>> that *every* architecture would need to define those macros, and i
>>> don't think that's the case at the moment.
>>>
>>>       
>> include]$ grep -L clear_page asm-*/page.h
>> asm-generic/page.h
>> asm-powerpc/page.h
>> include]$ grep -L copy_page asm-*/page.h
>> asm-generic/page.h
>> asm-powerpc/page.h
>>
>> so it seems it only needs to be defined on PowerPC. But what confuses me is:
>> ...
>> asm-x86_64/page.h:48:void clear_page(void *);
>> asm-x86_64/page.h:51:#define clear_user_page(page, vaddr, pg)
>> clear_page(page)
>> ...
>>
>> Is x86_64 setting all its memory to zero before giving it to the caller, or
>> what?
>>     
>
> i can check with the appropriate people.  i guess the major issue is
> whether the semantics of clear_page() are *meant* to be identical to a
> single page-sized call to memset().  technically, of course, they
>   
The only reason against it, would be if it is meant the address has to 
be a multiple of the PAGE_SIZE, but I find that unlikely.
> don't *have* to be -- clear_page() could always be defined to do
> something extra, but it doesn't seem like that's happening here, so a
> simple substitution would appear to be a valid cleanup, yes?
>   
I would think so. Just a bit concerned that PowerPC does not have it 
defined. I would rather see it defined in asm-generic and then if the 
arch has a better solution, it just undef the generic one. But that is 
just my opinion :)

Richard Knutsson

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2007-01-28 17:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-28  8:48 [KJ] clear_page() and copy_page() Robert P. J. Day
2007-01-28 15:51 ` Richard Knutsson
2007-01-28 16:09 ` Robert P. J. Day
2007-01-28 16:19 ` Robert P. J. Day
2007-01-28 17:41 ` Richard Knutsson [this message]
2007-01-29 11:42 ` Robert P. J. Day
  -- strict thread matches above, loose matches on Subject: below --
2007-03-08 20:39 [KJ] "clear_page" and "copy_page"? 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=45BCE055.7000508@student.ltu.se \
    --to=ricknu-0@student.ltu.se \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.