Re: oops if free a locked page

Linus Torvalds (torvalds@transmeta.com)
Tue, 22 Jun 1999 10:57:45 -0700 (PDT)


On Tue, 22 Jun 1999, Andrea Arcangeli wrote:
>
> I have a problem with pre-2.3.8-2. It issues an Oops if I attempt to free
> a locked page. I think I am allowed to free a locked page without first
> unlock it, because if there's a waiter waiting for the page, the waiter
> will have just increased the reference count of the page before go to
> sleep on the page.

No, you are NOT allowed to free a locked block. If you do, it's a bug.

The fact that the page is locked implies that it is going to be unlocked
by something later.

And there is not a chance in hell that that "later unlock" can validly
survive through a free_page() -> get_free_page() schenario.

In short, trying to free a locked page is always a bug.

> Right now I removed the BUG() in free-page.
>
> Comments?

Your patches will never get applied if you do stuff like that. That's
final.

Linus

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