Re: [PATCH, V2] i386: instead of poisoning .init zone, changeprotection bits to force a fault

From: Andrew Morton
Date: Mon Feb 06 2006 - 04:26:43 EST


Eric Dumazet <dada1@xxxxxxxxxxxxx> wrote:
>
> > #ifdef CONFIG_DEBUG_INITDATA
> > + /*
> > + * Unmap the page, and leak it. So any further accesses will
> > + * oops.
> > + */
> > change_page_attr(virt_to_page(addr), 1, __pgprot(0));
> > #else
> > memset((void *)addr, 0xcc, PAGE_SIZE);
> > -#endif
> > free_page(addr);
> > +#endif
> > totalram_pages++;
> > }
> > printk(KERN_INFO "Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
>
> I wonder if you dont have to move the 'totalram_pages++;' next to the
> free_page(addr) call (ie inside the #else/#endif block)
>

yup, thanks.

But I'm inclined to drop the whole patch - I don't see how it can detect
any bugs which CONFIG_DEBUG_PAGEALLOC won't find.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/