1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Correct handling of dirty pages in I/O buffers. The case where pages

residing in a buffer that had been dirtied by a process was being
handled incorrectly.  The pages were mistakenly placed into the
cache queue.  This would likely have the effect of mmaped page modifications
being lost when I/O system calls were being used simultaneously to
the same locations in a file.
Submitted by: davidg
This commit is contained in:
John Dyson 1996-03-09 06:46:51 +00:00
parent e5fadd05f2
commit 18ff64943e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14426

View File

@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
* $Id: vfs_bio.c,v 1.86 1996/03/02 04:40:55 dyson Exp $
* $Id: vfs_bio.c,v 1.87 1996/03/03 01:04:28 dyson Exp $
*/
/*
@ -611,12 +611,18 @@ vfs_vmio_release(bp)
vm_page_unwire(m);
if (m->wire_count == 0) {
if (m->valid) {
if(m->dirty == 0)
vm_page_test_dirty(m);
/*
* this keeps pressure off of the process memory
*/
if ((vm_swap_size == 0) ||
(cnt.v_free_count < cnt.v_free_min))
vm_page_cache(m);
(cnt.v_free_count < cnt.v_free_min)) {
if (m->dirty == 0)
vm_page_cache(m);
else
vm_page_deactivate(m);
}
} else if ((m->hold_count == 0) &&
((m->flags & PG_BUSY) == 0) &&
(m->busy == 0)) {