[lkml]   [2000]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Arjan van de Ven wrote:
> In article <> 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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:38    [W:0.233 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site