mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
- Correct a long-standing race condition in vm_page_try_to_free() that
could result in a dirty page being unintentionally freed. - Simplify the dirty page check in vm_page_dontneed(). Reviewed by: tegge MFC after: 7 days
This commit is contained in:
parent
3c8e9ebafb
commit
0f75a97722
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125990
@ -1316,11 +1316,10 @@ vm_page_try_to_free(vm_page_t m)
|
||||
(m->flags & (PG_BUSY|PG_UNMANAGED))) {
|
||||
return (0);
|
||||
}
|
||||
vm_page_test_dirty(m);
|
||||
pmap_remove_all(m);
|
||||
if (m->dirty)
|
||||
return (0);
|
||||
vm_page_busy(m);
|
||||
pmap_remove_all(m);
|
||||
vm_page_free(m);
|
||||
return (1);
|
||||
}
|
||||
@ -1405,8 +1404,8 @@ vm_page_dontneed(vm_page_t m)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m->dirty == 0)
|
||||
vm_page_test_dirty(m);
|
||||
if (m->dirty == 0 && pmap_is_modified(m))
|
||||
vm_page_dirty(m);
|
||||
|
||||
if (m->dirty || (dnw & 0x0070) == 0) {
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user