For unlinked files, do not msync(2) or sync on the vnode deactivation.
One consequence of the patch is that msyncing unlinked file mappings no longer reduces the amount of the dirty memory in the system, but I do not think that there are users of msync(2) that utilize it for such side-effect. Reported and tested by: tjil PR: 222356 Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D12411
This commit is contained in:
parent
ab99509219
commit
5bf949377e
@ -3054,8 +3054,8 @@ vinactive(struct vnode *vp, struct thread *td)
|
||||
* point that VOP_INACTIVE() is called, there could still be
|
||||
* pending I/O and dirty pages in the object.
|
||||
*/
|
||||
obj = vp->v_object;
|
||||
if (obj != NULL && (obj->flags & OBJ_MIGHTBEDIRTY) != 0) {
|
||||
if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 &&
|
||||
(obj->flags & OBJ_MIGHTBEDIRTY) != 0) {
|
||||
VM_OBJECT_WLOCK(obj);
|
||||
vm_object_page_clean(obj, 0, 0, 0);
|
||||
VM_OBJECT_WUNLOCK(obj);
|
||||
|
@ -1083,8 +1083,8 @@ vm_object_sync(vm_object_t object, vm_ooffset_t offset, vm_size_t size,
|
||||
* I/O.
|
||||
*/
|
||||
if (object->type == OBJT_VNODE &&
|
||||
(object->flags & OBJ_MIGHTBEDIRTY) != 0) {
|
||||
vp = object->handle;
|
||||
(object->flags & OBJ_MIGHTBEDIRTY) != 0 &&
|
||||
((vp = object->handle)->v_vflag & VV_NOSYNC) == 0) {
|
||||
VM_OBJECT_WUNLOCK(object);
|
||||
(void) vn_start_write(vp, &mp, V_WAIT);
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
|
Loading…
Reference in New Issue
Block a user