lkml.org 
[lkml]   [2006]   [Dec]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: replace "memset(...,0,PAGE_SIZE)" calls with "clear_page()"?
    Date
    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
    -
    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: 2006-12-30 23:45    [W:0.020 / U:0.960 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site