lkml.org 
[lkml]   [2007]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: why does the macro "ZERO_PAGE" take an argument?
    On Thu, 7 Jun 2007, Satyam Sharma wrote:

    > On 6/7/07, Robert P. J. Day <rpjday@mindspring.com> wrote:
    > > On Thu, 7 Jun 2007, Nick Piggin wrote:
    > >
    > > > Robert P. J. Day wrote:
    > > > > probably making a fool of myself here, but what is the purpose of
    > > > > that single argument to the macro "ZERO_PAGE"?
    > > > >
    > > > > $ grep -r "define ZERO_PAGE" include
    > > > > include/asm-frv/pgtable.h:#define ZERO_PAGE(vaddr) ({ BUG(); NULL;
    > > })
    > > > > include/asm-frv/pgtable.h:#define ZERO_PAGE(vaddr)
    > > > > virt_to_page(empty_zero_page)
    > > > > include/asm-v850/pgtable.h:#define ZERO_PAGE(vaddr) ((void
    > > *)0x87654321)
    > > > > include/asm-mips/pgtable.h:#define ZERO_PAGE(vaddr) \
    > > > > include/asm-blackfin/pgtable.h:#define ZERO_PAGE(vaddr)
    > > (virt_to_page(0))
    > > > > include/asm-parisc/pgtable.h:#define ZERO_PAGE(vaddr)
    > > > > (virt_to_page(empty_zero_page))
    > > > > include/asm-alpha/pgtable.h:#define ZERO_PAGE(vaddr)
    > > > > (virt_to_page(ZERO_PGE))
    > > > > ...
    > > > >
    > > > > AFAICT, there are no definitions of that macro that actually use
    > > > > that argument. is that some kind of historical cruft?
    > > >
    > > > MIPS?
    > >
    > > argh. that would be the *one* definition whose output got chopped
    > > because of line continuation, and it would be only one that actually
    > > uses the argument:
    > >
    > > #define ZERO_PAGE(vaddr) \
    > > (virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) &
    > > zero_page_mask))))
    > >
    > >
    > > but it still leaves the question -- if ZERO_PAGE is meant to represent
    > > a single, global shared page that is always zero, why would it *ever*
    > > need to take an argument? and what's so special about MIPS that it
    > > differs from all the rest?
    >
    > The comment above empty_zero_page and zero_page_mask
    > declarations at arch/mips/mm/init.c:508 sheds light on this ...

    well, it *sort of* does. at line 64 of that file:

    /*
    * We have up to 8 empty zeroed pages so we can map one of the right colour
    * when needed. This is necessary only on R4000 / R4400 SC and MC versions
    * where we have to avoid VCED / VECI exceptions for good performance at
    * any price. Since page is never written to after the initialization we
    * don't have to care about aliases on other CPUs.
    */

    although it's not clear where in the source tree are the invocations
    that would actually make a difference to a MIPS system, which is why
    i've CC'ed ralf on this. i'm sure he can clear this up. :-)

    rday
    --
    ========================================================================
    Robert P. J. Day
    Linux Consulting, Training and Annoying Kernel Pedantry
    Waterloo, Ontario, CANADA

    http://fsdev.net/wiki/index.php?title=Main_Page
    ========================================================================
    -
    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/

    \
     
     \ /
      Last update: 2007-06-07 13:59    [W:0.028 / U:93.696 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site