lkml.org 
[lkml]   [2000]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Arjan van de Ven wrote:
>
> In article <Pine.LNX.4.10.10009031328090.1691-100000@penguin.transmeta.com> 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
option.

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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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