Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 1996 00:01:39 -0500 (EST)
From:      "John S. Dyson" <toor@dyson.iquest.net>
To:        pst@jnx.com, joerg_wunsch@uriah.heep.sax.de, jdp@polstra.com, current@freebsd.org
Cc:        karl@mcs.net
Subject:   Need help testing this maybe NFS fix
Message-ID:  <199610160501.AAA00379@dyson.iquest.net>

next in thread | raw e-mail | index | archive | help
During the rundown of forcibly dismounted NFS filesystems,
there is some sloppyness in the handling of the VM objects
associated with the files on the filesystems.  Included
with this message is a patch file that fixes that problem,
and also improves the swapping algorithm by making processes
that have been waken up from a sleep and who are swapped out
eligible immediately for being swapped in.

The main reason for this mailing is to get some feedback
on a perspective NFS fix, and the swapping fix is only a
side-effect of my current tree...  Please let me know as
soon as you can the positive or negative outcomes of running
with this code...

Thanks!!!
John


Index: kern/kern_synch.c
===================================================================
RCS file: /local/home/ncvs/src/sys/kern/kern_synch.c,v
retrieving revision 1.25
diff -r1.25 kern_synch.c
463a464
> 					p->p_flag |= P_SWAPINREQ;
508a510
> 					p->p_flag |= P_SWAPINREQ;
627c629,630
< 	if ((p->p_flag & P_INMEM) == 0)
---
> 	if ((p->p_flag & P_INMEM) == 0) {
> 		p->p_flag |= P_SWAPINREQ;
628a632
> 	}
Index: kern/vfs_subr.c
===================================================================
RCS file: /local/home/ncvs/src/sys/kern/vfs_subr.c,v
retrieving revision 1.61
diff -r1.61 vfs_subr.c
982c982,983
< 		if ((vp->v_usecount == 1) && vp->v_object) {
---
> 		if (vp->v_object && (vp->v_object->flags & OBJ_VFS_REF)) {
> 			vm_object_reference(vp->v_object);
983a985,986
> 			vp->v_object->flags &= ~OBJ_VFS_REF;
> 			vm_object_deallocate(vp->v_object);
993a997
> 
1151a1156,1160
> 
> 	if (vp->v_object) {
> 		vp->v_object->flags |= OBJ_VNODE_GONE;
> 	}
> 
Index: sys/proc.h
===================================================================
RCS file: /local/home/ncvs/src/sys/sys/proc.h,v
retrieving revision 1.29
diff -r1.29 proc.h
217a218
> #define	P_SWAPINREQ	0x80000	/* Swapin request due to wakeup */
Index: vm/vm_glue.c
===================================================================
RCS file: /local/home/ncvs/src/sys/vm/vm_glue.c,v
retrieving revision 1.54
diff -r1.54 vm_glue.c
322c322,325
< 			pri = p->p_swtime + p->p_slptime - p->p_nice * 8;
---
> 			pri = p->p_swtime + p->p_slptime;
> 			if ((p->p_flag & P_SWAPINREQ) == 0) {
> 				pri -= p->p_nice * 8;
> 			}
337c340
< 	 * Nothing to do, back to sleep
---
> 	 * Nothing to do, back to sleep.
342a346,347
> 	p->p_flag &= ~P_SWAPINREQ;
> 
Index: vm/vm_object.h
===================================================================
RCS file: /local/home/ncvs/src/sys/vm/vm_object.h,v
retrieving revision 1.31
diff -r1.31 vm_object.h
135a136
> #define OBJ_VNODE_GONE	0x0800		/* vnode is gone */
Index: vm/vnode_pager.c
===================================================================
RCS file: /local/home/ncvs/src/sys/vm/vnode_pager.c,v
retrieving revision 1.64
diff -r1.64 vnode_pager.c
616a617,618
> 	if (object->flags & OBJ_VNODE_GONE)
> 		return VM_PAGER_ERROR;
859a862,865
> 
> 	if (object->flags & OBJ_VNODE_GONE)
> 		return VM_PAGER_ERROR;
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610160501.AAA00379>