From owner-freebsd-fs Sun Apr 26 14:07:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA18603 for freebsd-fs-outgoing; Sun, 26 Apr 1998 14:04:57 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from helios.dnttm.ru (root@dnttm-gw.rssi.ru [193.232.0.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA16201 for ; Sun, 26 Apr 1998 13:48:31 -0700 (PDT) (envelope-from dima@tejblum.dnttm.rssi.ru) Received: (from uucp@localhost) by helios.dnttm.ru (8.8.5/8.8.5/IP-3) with UUCP id AAA18675 for freebsd-fs@freebsd.org; Mon, 27 Apr 1998 00:46:18 +0400 Received: from tejblum.dnttm.rssi.ru (localhost [127.0.0.1]) by tejblum.dnttm.rssi.ru (8.8.8/8.8.7) with ESMTP id AAA01087 for ; Mon, 27 Apr 1998 00:43:13 +0400 (MSD) (envelope-from dima@tejblum.dnttm.rssi.ru) Message-Id: <199804262043.AAA01087@tejblum.dnttm.rssi.ru> X-Mailer: exmh version 2.0gamma 1/27/96 To: freebsd-fs@FreeBSD.ORG Subject: VFS_SYNC(MNT_LAZY) Mime-Version: 1.0 Content-Type: text/plain Date: Mon, 27 Apr 1998 00:43:13 +0400 From: Dmitrij Tejblum Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is called every 30 seconds by the syncer daemon for every filesystem mounted read-write. Is there any good reason why every filesystem walk through list of all vnodes, lock every vnode, check for waitfor == MNT_LAZY, and in this case unlock and skip the vnode? I may replace this with goto around this loop, if nobody object. Then, ffs_sync does not "flush filesystem control information" with MNT_LAZY. (That is, it doen't call VOP_FSYNC on the device). Should it be same way in other filesystems? Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Apr 27 05:33:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA29889 for freebsd-fs-outgoing; Mon, 27 Apr 1998 05:33:21 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA29875 for ; Mon, 27 Apr 1998 05:33:16 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id WAA01699; Mon, 27 Apr 1998 22:25:28 +1000 Date: Mon, 27 Apr 1998 22:25:28 +1000 From: Bruce Evans Message-Id: <199804271225.WAA01699@godzilla.zeta.org.au> To: dima@tejblum.dnttm.rssi.ru, freebsd-fs@FreeBSD.ORG Subject: Re: VFS_SYNC(MNT_LAZY) Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >This is called every 30 seconds by the syncer daemon for every >filesystem mounted read-write. > >Is there any good reason why every filesystem walk through list of all >vnodes, lock every vnode, check for waitfor == MNT_LAZY, and in this >case unlock and skip the vnode? Well, in ffs_sync(), the loop checks for pending updates. I can't see anywhere else where this is done. OTOH, after finding a pending update, it is probably a pessimization to do a full VOP_FSYNC() instead of just an !MNT_NOWAIT update whose delayed write would eventually be handled by the syncer daemon. This assumes that the (waitfor == MNT_LAZY) check is correct and we're not depending on the vnode getting fsynced as a side effect of finding a pending update. msdosfs_sync() and ext2fs_sync() seem to be just broken. msdosfs_sync() has the (waitfor == MNT_LAZY) check in a different place, so the check can be moved outside of the loop. I can't see how pending updates can work right. ext2fs_sync() is missing the check, so it does even more premature VOP_FSYNC()s than ffs_sync(). >I may replace this with goto around this loop, if nobody object. I object :-). >Then, ffs_sync does not "flush filesystem control information" with >MNT_LAZY. (That is, it doen't call VOP_FSYNC on the device). Should it >be same way in other filesystems? I think the only "filesystem control information" is bitmap blocks, and the syncer daemon handles the write, somewhat more delayed than before. Superblocks are still written using async writes in the !MNT_NOWAIT case. I think delaying all these writes as long as the syncer daemon wants to is correct. Bitmap blocks are written using delayed writes even in the MNT_SYNCHRONOUS case. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Mon Apr 27 18:12:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA26649 for freebsd-fs-outgoing; Mon, 27 Apr 1998 18:12:28 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from parkplace.cet.co.jp (parkplace.cet.co.jp [202.32.64.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA26629 for ; Mon, 27 Apr 1998 18:12:21 -0700 (PDT) (envelope-from michaelh@cet.co.jp) Received: from localhost (michaelh@localhost) by parkplace.cet.co.jp (8.8.8/CET-v2.2) with SMTP id BAA21998; Tue, 28 Apr 1998 01:11:12 GMT Date: Tue, 28 Apr 1998 10:11:11 +0900 (JST) From: Michael Hancock To: Dmitrij Tejblum cc: freebsd-fs@FreeBSD.ORG Subject: Re: VFS_SYNC(MNT_LAZY) In-Reply-To: <199804262043.AAA01087@tejblum.dnttm.rssi.ru> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org If you haven't already you should read the Ganger & Patt papers and look at the softupdate code before you change anything that has to do with the syncer. When using softupdates, most of both synchronous and asynchronous writes become delayed writes and the syncer has an even more important role than before. Regards, Mike On Mon, 27 Apr 1998, Dmitrij Tejblum wrote: > This is called every 30 seconds by the syncer daemon for every > filesystem mounted read-write. > > Is there any good reason why every filesystem walk through list of all > vnodes, lock every vnode, check for waitfor == MNT_LAZY, and in this > case unlock and skip the vnode? > > I may replace this with goto around this loop, if nobody object. > > Then, ffs_sync does not "flush filesystem control information" with > MNT_LAZY. (That is, it doen't call VOP_FSYNC on the device). Should it > be same way in other filesystems? > > Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Tue Apr 28 01:43:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA26331 for freebsd-fs-outgoing; Tue, 28 Apr 1998 01:43:52 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from helios.dnttm.ru (root@dnttm-gw.rssi.ru [193.232.0.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA26304 for ; Tue, 28 Apr 1998 01:43:43 -0700 (PDT) (envelope-from dima@tejblum.dnttm.rssi.ru) Received: (from uucp@localhost) by helios.dnttm.ru (8.8.5/8.8.5/IP-3) with UUCP id MAA15428; Tue, 28 Apr 1998 12:29:21 +0400 Received: from tejblum.dnttm.rssi.ru (localhost [127.0.0.1]) by tejblum.dnttm.rssi.ru (8.8.8/8.8.7) with ESMTP id MAA02029; Tue, 28 Apr 1998 12:27:54 +0400 (MSD) (envelope-from dima@tejblum.dnttm.rssi.ru) Message-Id: <199804280827.MAA02029@tejblum.dnttm.rssi.ru> X-Mailer: exmh version 2.0gamma 1/27/96 To: Bruce Evans cc: freebsd-fs@FreeBSD.ORG, tejblum@arc.hq.cti.ru Subject: Re: VFS_SYNC(MNT_LAZY) In-reply-to: Your message of "Mon, 27 Apr 1998 22:25:28 +1000." <199804271225.WAA01699@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain Date: Tue, 28 Apr 1998 12:27:53 +0400 From: Dmitrij Tejblum Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Bruce Evans wrote: > > Well, in ffs_sync(), the loop checks for pending updates. I can't see > anywhere else where this is done. Oops, I overlooked that. Too many parenthesis... > msdosfs_sync() and ext2fs_sync() seem to be just broken. msdosfs_sync() > has the (waitfor == MNT_LAZY) check in a different place, so the check > can be moved outside of the loop. I can't see how pending updates can > work right. So I will sync msdosfs_sync with ffs_sync for now. Thanks for your explanation. Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message From owner-freebsd-fs Tue Apr 28 05:13:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA05472 for freebsd-fs-outgoing; Tue, 28 Apr 1998 05:13:30 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA05465 for ; Tue, 28 Apr 1998 05:13:28 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id VAA30655; Tue, 28 Apr 1998 21:54:45 +1000 Date: Tue, 28 Apr 1998 21:54:45 +1000 From: Bruce Evans Message-Id: <199804281154.VAA30655@godzilla.zeta.org.au> To: bde@zeta.org.au, dima@tejblum.dnttm.rssi.ru Subject: Re: VFS_SYNC(MNT_LAZY) Cc: freebsd-fs@FreeBSD.ORG, tejblum@arc.hq.cti.ru Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >> Well, in ffs_sync(), the loop checks for pending updates. I can't see >> anywhere else where this is done. > >Oops, I overlooked that. Too many parenthesis... Yes, it is a good example of code obfuscated using unnecessary parentheses and other style bugs :-). See OpenBSD for better approximations to KNF. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message