From owner-freebsd-stable@FreeBSD.ORG Thu Jan 10 05:33:13 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A6D716A417; Thu, 10 Jan 2008 05:33:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 8C57B13C4D9; Thu, 10 Jan 2008 05:33:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=deviant.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JCq2K-0005gh-Ic; Thu, 10 Jan 2008 07:33:11 +0200 Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m0A5X3Ge044704; Thu, 10 Jan 2008 07:33:03 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m0A5X354044703; Thu, 10 Jan 2008 07:33:03 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 10 Jan 2008 07:33:03 +0200 From: Kostik Belousov To: "J.R. Oldroyd" Message-ID: <20080110053303.GC57756@deviant.kiev.zoral.com.ua> References: <4783D41B.3000204@FreeBSD.org> <4783D748.1050401@raad.tartu.ee> <4783D824.1050502@FreeBSD.org> <4783DB72.6030605@raad.tartu.ee> <4783DCAA.1080108@FreeBSD.org> <4783EA7E.1050008@raad.tartu.ee> <4783ED15.1060606@FreeBSD.org> <20080109141859.74d08743@linwhf.opal.com> <478522B5.5030101@FreeBSD.org> <20080109235819.7707133d@linwhf.opal.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U06nEXQpEf10f9fB" Content-Disposition: inline In-Reply-To: <20080109235819.7707133d@linwhf.opal.com> User-Agent: Mutt/1.4.2.3i X-Scanner-Signature: 63e2ad49ecdb9688bd8f281dc7b291dd X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 1976 [Dec 29 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: Kris Kennaway , freebsd-stable@freebsd.org Subject: Re: 7.0BETA4 desktop system also periodically freezes X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2008 05:33:13 -0000 --U06nEXQpEf10f9fB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 09, 2008 at 11:58:19PM -0500, J.R. Oldroyd wrote: > On Wed, 09 Jan 2008 20:38:29 +0100, Kris Kennaway wrot= e: > > > >=20 > > OK, same requests as to the others then. > >=20 >=20 > I presume you mean hwpmc... >=20 > In setting that up, I may have stumbled upon a possible cause. > I ran pmcstat for a while and ended up with a very large output > file. Having not noticed any freezes during that time, I decided > to start over with the output to a different filesystem with more > free space. When I removed that first output file, the resulting > disk i/o for the block deallocation caused a very similar freeze > for a few seconds. And when it came back, the load average graph > peaked up, just as before. >=20 > This appears to be repeatable: >=20 > 1. create a very large file, say 1Gb or so > 2. remove it > 3. observe freeze during file dealloc i/o activity >=20 > This on an ata drive, ufs filesystem with softupdates. >=20 > Folk complaining of jerky mouse syndrome (e.g., during compilations) > may be seeing the same - the compiler creates and removes lots of > files. >=20 > I'm not sure how this would explain those longer freezes (30s or > several minutes) though. For the SU-imposed jerkiness, try the patch below. Progress on developing the change stalled somehow, and I would like to process with it. diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 248ce22..005f915 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -2001,6 +2001,12 @@ __mnt_vnode_next(struct vnode **mvp, struct mount *m= p) mtx_assert(MNT_MTX(mp), MA_OWNED); =20 KASSERT((*mvp)->v_mount =3D=3D mp, ("marker vnode mount list mismatch")); + if ((*mvp)->v_yield++ =3D=3D 500) { + MNT_IUNLOCK(mp); + (*mvp)->v_yield =3D 0; + uio_yield(); + MNT_ILOCK(mp); + } vp =3D TAILQ_NEXT(*mvp, v_nmntvnodes); while (vp !=3D NULL && vp->v_type =3D=3D VMARKER) vp =3D TAILQ_NEXT(vp, v_nmntvnodes); diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 0525a43..1ac289a 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -131,6 +131,7 @@ struct vnode { struct socket *vu_socket; /* v unix domain net (VSOCK) */ struct cdev *vu_cdev; /* v device (VCHR, VBLK) */ struct fifoinfo *vu_fifoinfo; /* v fifo (VFIFO) */ + int vu_yield; /* yield count (VMARKER) */ } v_un; =20 /* @@ -185,6 +186,7 @@ struct vnode { #define v_socket v_un.vu_socket #define v_rdev v_un.vu_cdev #define v_fifoinfo v_un.vu_fifoinfo +#define v_yield v_un.vu_yield =20 /* XXX: These are temporary to avoid a source sweep at this time */ #define v_object v_bufobj.bo_object diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index a221b66..02cf45b 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -864,6 +864,7 @@ softdep_process_worklist(mp, full) */ if (loopcount++ % 128 =3D=3D 0) { FREE_LOCK(&lk); + uio_yield(); bwillwrite(); ACQUIRE_LOCK(&lk); } --U06nEXQpEf10f9fB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHha4OC3+MBN1Mb4gRAuJqAJ9ddrTwSREYVsRzoDZOYqWT+YCubgCgnCc7 ma8oolIVP5ccUHdi6nZsQd4= =j8hC -----END PGP SIGNATURE----- --U06nEXQpEf10f9fB--