I was reading http://linux-mm.org/PageAllocation, and came across this
arch-indep mm/page_alloc.c, there is a static function bad_page():

static void bad_page(struct page *page)
{
        printk(KERN_EMERG "Bad page state in process '%s'\n"
                KERN_EMERG "page:%p flags:0x%0*lx mapping:%p
mapcount:%d count:%d\n"
                KERN_EMERG "Trying to fix it up, but a reboot is needed\n"
                KERN_EMERG "Backtrace:\n",
                current->comm, page, (int)(2*sizeof(unsigned long)),
                (unsigned long)page->flags, page->mapping,
                page_mapcount(page), page_count(page));
        dump_stack();
        page->flags &= ~(1 << PG_lru    |
                        1 << PG_private |
                        1 << PG_locked  |
                        1 << PG_active  |
                        1 << PG_dirty   |
                        1 << PG_reclaim |
                        1 << PG_slab    |
                        1 << PG_swapcache |
                        1 << PG_writeback |
                        1 << PG_buddy );
        set_page_count(page, 0);
        reset_page_mapcount(page);
        page->mapping = NULL;
        add_taint(TAINT_BAD_PAGE);
}

Question:

a.   what is the purpose of this function - it seems that all the
caller of this function will continue execution as if nothing has
happened?   And the next line may process the "page" which this
funcion has modify?
b.   what is the purpose of setting to NOT the list of PG_xxxx flags
shown above?
c.   What is the purpose of the add_taint() function?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to