diff options
| author | Alan Cox <alc@FreeBSD.org> | 2004-02-10 18:34:27 +0000 |
|---|---|---|
| committer | Alan Cox <alc@FreeBSD.org> | 2004-02-10 18:34:27 +0000 |
| commit | a3dfacb51c0fb953a85651de4cc206fb30e5969e (patch) | |
| tree | 925208e1537c73c5e3af9132ee366b748e8ec29c | |
| parent | 9c43d53bb893bfb06fbd564f11b1b36314ba341c (diff) | |
Notes
| -rw-r--r-- | sys/vm/vm_pageout.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 506f1ec84a39..f807b772121b 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -803,6 +803,21 @@ rescan0: */ if (m->dirty == 0) { vm_page_test_dirty(m); + /* + * Avoid a race condition: Unless write access is + * removed from the page, another processor could + * modify it before all access is removed by the call + * to vm_page_cache() below. If vm_page_cache() finds + * that the page has been modified when it removes all + * access, it panics because it cannot cache dirty + * pages. In principle, we could eliminate just write + * access here rather than all access. In the expected + * case, when there are no last instant modifications + * to the page, removing all access will be cheaper + * overall. + */ + if (m->dirty == 0 && (m->flags & PG_WRITEABLE) != 0) + pmap_remove_all(m); } else { vm_page_dirty(m); } |
