From owner-freebsd-fs Fri Feb 27 08:14:37 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA10783 for freebsd-fs-outgoing; Fri, 27 Feb 1998 08:14:37 -0800 (PST) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from critter.freebsd.dk (critter.freebsd.dk [195.8.129.14]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA10740 for ; Fri, 27 Feb 1998 08:14:22 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.8.7/8.8.5) with ESMTP id RAA03418; Fri, 27 Feb 1998 17:07:05 +0100 (CET) To: Eivind Eklund cc: fs@FreeBSD.ORG Subject: Re: syncer / SMP question In-reply-to: Your message of "Fri, 27 Feb 1998 16:48:59 +0100." <19980227164859.25557@follo.net> Date: Fri, 27 Feb 1998 17:07:05 +0100 Message-ID: <3416.888595625@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Uhm, this is part&parcel of Kirks softupdate code, so I wouldn't bother if I were you... Poul-Henning In message <19980227164859.25557@follo.net>, Eivind Eklund writes: >I was looking at implementing an incremental syncer for UFS, as a sort >of "let's get to know the FS-code" project, and noticed something that >looked like really strange code in the sync() syscall. Is there any >reason why the below wouldn't be a benign change? The extra >simplelock-call looks especially weird - it looks like either the lock >is released somewhere else, or we'll have the mountlist locked many >times. > >If it looks like a benign change, what would I do to test it properly? >I can allocate a scratch machine to do this if there is no need for >really long-running tests. I can probably even do a scratchable >SMP-box. > >cvs diff: Diffing . >Index: vfs_syscalls.c >=================================================================== >RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v >retrieving revision 1.93 >diff -u -u -5 -r1.93 vfs_syscalls.c >--- vfs_syscalls.c 1998/02/15 04:17:09 1.93 >+++ vfs_syscalls.c 1998/02/27 15:37:16 >@@ -480,24 +480,21 @@ > register struct mount *mp, *nmp; > int asyncflag; > > simple_lock(&mountlist_slock); > for (mp = mountlist.cqh_first; mp != (void *)&mountlist; mp = nmp) { >+ nmp = mp->mnt_list.cqe_next; > if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock, p)) { >- nmp = mp->mnt_list.cqe_next; > continue; > } > if ((mp->mnt_flag & MNT_RDONLY) == 0) { > asyncflag = mp->mnt_flag & MNT_ASYNC; > mp->mnt_flag &= ~MNT_ASYNC; > vfs_msync(mp, MNT_NOWAIT); > VFS_SYNC(mp, MNT_NOWAIT, p != NULL ? p->p_ucred : NOC >RED, p); >- if (asyncflag) >- mp->mnt_flag |= MNT_ASYNC; >+ mp->mnt_flag |= asyncflag; > } >- simple_lock(&mountlist_slock); >- nmp = mp->mnt_list.cqe_next; > vfs_unbusy(mp, p); > } > simple_unlock(&mountlist_slock); > #if 0 > /* > >Eivind. >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-fs" in the body of the message > -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop." "Drink MONO-tonic, it goes down but it will NEVER come back up!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message