oopses in test10-pre4 (was Re: [RFC] atomic pte updates and pae changes, take 3)

From: Linus Torvalds (torvalds@transmeta.com)
Date: Thu Oct 19 2000 - 15:16:37 EST


Ben,
 you added these two BUG() conditions in your atomic pte patch:

> diff -ur v2.4.0-test10-pre2/mm/vmscan.c work-10-2/mm/vmscan.c
> --- v2.4.0-test10-pre2/mm/vmscan.c Fri Oct 13 17:18:37 2000
> +++ work-10-2/mm/vmscan.c Fri Oct 13 17:19:47 2000
> @@ -99,6 +98,10 @@
> if (PageSwapCache(page)) {
> entry.val = page->index;
> swap_duplicate(entry);
> + if (pte_dirty(pte))
> + BUG();
> + if (pte_write(pte))
> + BUG();
> set_pte(page_table, swp_entry_to_pte(entry));
> drop_pte:
> UnlockPage(page);
> @@ -109,6 +112,13 @@

and people are getting them left and right when they start swapping.

As far as I can tell, the thing you test for is not actually a bug at all.
The pte may be dirty, but that's ok - the swap cache page is obviously
up-to-date, as it's actually physically the very same page.

I think you overlooked the fact that SHM mappings use the page cache, and
it's ok if such pages are dirty and writable - they will get written out
by the shm_swap() logic once there are no mappings active any more.

I like the test per se, because I think it's correct for the "normal"
case of a private page, but I really think those two BUG()'s are not bugs
at all in general, and we should just remove the two tests.

Comments? Anything I've overlooked?

                        Linus

-
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 : Mon Oct 23 2000 - 21:00:15 EST