lkml.org 
[lkml]   [2013]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2, part3 01/12] mm: enhance free_reserved_area() to support poisoning memory with zero
    On 03/17/2013 01:37 AM, Geert Uytterhoeven wrote:
    > On Sat, Mar 16, 2013 at 6:03 PM, Jiang Liu <liuj97@gmail.com> wrote:
    >> --- a/mm/page_alloc.c
    >> +++ b/mm/page_alloc.c
    >> @@ -5130,13 +5130,13 @@ unsigned long free_reserved_area(unsigned long start, unsigned long end,
    >> pos = start = PAGE_ALIGN(start);
    >> end &= PAGE_MASK;
    >> for (pages = 0; pos < end; pos += PAGE_SIZE, pages++) {
    >> - if (poison)
    >> + if ((unsigned int)poison <= 0xFF)
    >
    > "if (poison >= 0)"? No cast needed.
    Hi Geert,
    We constraints valid inputs as [0, UCHAR_MAX], so the code follows the comment as below.
    /*
    * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK)
    * into the buddy system. The freed pages will be poisoned with pattern
    * "poison" if it's within range [0, UCHAR_MAX].
    * Return pages freed into the buddy system.
    */

    Regards!
    Gerry

    >
    >> memset((void *)pos, poison, PAGE_SIZE);
    >
    > Gr{oetje,eeting}s,
    >
    > Geert
    >
    > --
    > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
    >
    > In personal conversations with technical people, I call myself a hacker. But
    > when I'm talking to journalists I just say "programmer" or something like that.
    > -- Linus Torvalds
    >



    \
     
     \ /
      Last update: 2013-03-16 19:21    [W:2.854 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site