Re: qmail uses 100% cpu after FreeBSD-5.0 to 5.1 upgrade

From: Don Lewis <truckman_at_FreeBSD.org>
Date: Mon, 16 Jun 2003 04:12:51 -0700 (PDT)
On 16 Jun, Thorsten Schroeder wrote:
> Hi,
> 
> On Sun, 15 Jun 2003, Don Lewis wrote:
> 
>> > I don't know what it could be - perhaps a problem with named pipes
>> > ("lock/trigger")?
>> >
>> > You can find my ktrace output here: http://cs.so36.net/~ths/kdump.txt
> 
>> Which version of fifo_vnops.c?  If the problem is present in
>> 5.1-RELEASE, then the problem is likely to be the change made in 1.79
>> and 1.85.  If the problem didn't show up until after the 5.1-RELEASE,
>> then the problem could be the changes in 1.87 or 1.88.
> 
> FreeBSD 5.1-CURRENT #1: Thu Jun  5 19:29:29 CEST 2003
> 
> fifo_vnops.c:
> 
> $FreeBSD: src/sys/fs/fifofs/fifo_vnops.c,v 1.87 2003/06/01 06:24:32 truckman Exp $


Try upgrading to 1.88 and applying this patch:

Index: sys/fs/fifofs/fifo_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/fifofs/fifo_vnops.c,v
retrieving revision 1.88
diff -u -r1.88 fifo_vnops.c
--- sys/fs/fifofs/fifo_vnops.c	13 Jun 2003 06:58:11 -0000	1.88
+++ sys/fs/fifofs/fifo_vnops.c	16 Jun 2003 08:44:20 -0000
_at__at_ -70,7 +70,6 _at__at_
 static int	fifo_lookup(struct vop_lookup_args *);
 static int	fifo_open(struct vop_open_args *);
 static int	fifo_close(struct vop_close_args *);
-static int	fifo_inactive(struct vop_inactive_args *);
 static int	fifo_read(struct vop_read_args *);
 static int	fifo_write(struct vop_write_args *);
 static int	fifo_ioctl(struct vop_ioctl_args *);
_at__at_ -98,7 +97,6 _at__at_
 	{ &vop_create_desc,		(vop_t *) vop_panic },
 	{ &vop_getattr_desc,		(vop_t *) vop_ebadf },
 	{ &vop_getwritemount_desc, 	(vop_t *) vop_stdgetwritemount },
-	{ &vop_inactive_desc,		(vop_t *) fifo_inactive },
 	{ &vop_ioctl_desc,		(vop_t *) fifo_ioctl },
 	{ &vop_kqfilter_desc,		(vop_t *) fifo_kqfilter },
 	{ &vop_lease_desc,		(vop_t *) vop_null },
_at__at_ -556,32 +554,18 _at__at_
 		if (fip->fi_writers == 0)
 			socantrcvmore(fip->fi_readsock);
 	}
-	VOP_UNLOCK(vp, 0, td);
-	return (0);
-}
-
-static int
-fifo_inactive(ap)
-	struct vop_inactive_args /* {
-		struct vnode *a_vp;
-		struct thread *a_td;
-	} */ *ap;
-{
-	struct vnode *vp = ap->a_vp;
-	struct fifoinfo *fip = vp->v_fifoinfo;
-
 	VI_LOCK(vp);
-	if (fip != NULL && vp->v_usecount == 0) {
+	if (vp->v_usecount == 1) {
 		vp->v_fifoinfo = NULL;
 		VI_UNLOCK(vp);
 		(void)soclose(fip->fi_readsock);
 		(void)soclose(fip->fi_writesock);
 		FREE(fip, M_VNODE);
-	}
-	VOP_UNLOCK(vp, 0, ap->a_td);
+	} else
+		VI_UNLOCK(vp);
+	VOP_UNLOCK(vp, 0, td);
 	return (0);
 }
-
 
 /*
  * Print out internal contents of a fifo vnode.
Received on Mon Jun 16 2003 - 02:13:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:12 UTC