Re: 2.4.0-test8-pre1 is quite bad / how about integrating Rik's VM now?

From: Daniel Phillips (news-innominate.list.linux.kernel@innominate.de)
Date: Mon Sep 04 2000 - 04:09:47 EST


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/



This archive was generated by hypermail 2b29 : Thu Sep 07 2000 - 21:00:17 EST