Arjan van de Ven wrote:
> In article <Pine.LNX.firstname.lastname@example.org> you wrote:
> > Well, the bug seems to exactly using the page after a "free_page()". Which
> > is always a bug, but at least should be easy to fix.
> > I've considered making "free_page()" a macro something like
> > __free_page(x);
> > x = NULL;
> Maybe the trick electric fence uses might work. efence unmaps the page from
> the page tables... and of course the get_free_page function would have to
> map it into the tables. Not for normal use, but for debugging it may help.
Yes, in simple terms it's illegal to use a page when it's free and you
want get an error if you do. It's something that will never happen in
correct code, so this seems like an ideal thing to have as a debug
I took a quick tour through the source and found that in the vast
majority of cases free_page is called on a local variable just before
returning. Nulling x doesn't do much - a smart optimizer would just
remove that code. In these cases, nulling the pointer won't catch any
mistakes, but unmapping the page quite possibly will.
-- Daniel - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to email@example.com Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:17 EST