lkml.org 
[lkml]   [2009]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 10/22] HWPOISON: check and isolate corrupted free pages v2
    On Tue, 16 Jun 2009, Wu Fengguang wrote:
    >
    > Right. Then the original __ClearPageBuddy() call in bad_page() is
    > questionable, I guess this line was there just for the sake of safety
    > (ie. the buddy allocator itself goes wrong):
    >
    > sound-2.6/mm/page_alloc.c
    >
    > @@ -269,7 +269,6 @@ static void bad_page(struct page *page)
    > dump_stack();
    > out:
    > /* Leave bad fields for debug, except PageBuddy could make trouble */
    > ===> __ClearPageBuddy(page);
    > add_taint(TAINT_BAD_PAGE);
    > }

    I didn't put that in for the case of the buddy allocator going wrong
    (not sure if there could be such a case - I don't mean that the buddy
    allocator is provably perfect! but how would it get here if it were
    wrong?). No, I put that in for the case when the flag bits in struct
    page have themselves got corrupted somehow, and hence we arrive at
    bad_page(): most of the bits are best left as they are, to provide
    maximum debug info; but leaving PageBuddy set there might conceivably
    allow this corrupted struct page to get paired up with its buddy later,
    and so freed for reuse, when we're trying to make sure it's never reused.

    Hugh


    \
     
     \ /
      Last update: 2009-06-16 13:33    [W:2.785 / U:0.304 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site