From: OGAWA Hirofumi Subject: Re: [PATCH] Optimize wait_sb_inodes() Date: Thu, 27 Jun 2013 09:01:23 +0900 Message-ID: <8761x08lrg.fsf@devron.myhome.or.jp> References: <87ehbpntuk.fsf@devron.myhome.or.jp> <20130626143222.GA27481@logfs.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: linux-fsdevel@vger.kernel.org, tux3@tux3.org, Al Viro , linux-kernel@vger.kernel.org To: =?iso-8859-1?Q?J=F6rn?= Engel Return-path: In-Reply-To: <20130626143222.GA27481@logfs.org> (=?iso-8859-1?Q?=22J=F6rn?= Engel"'s message of "Wed, 26 Jun 2013 10:32:22 -0400") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tux3-bounces@phunq.net Sender: tux3-bounces@phunq.net List-Id: linux-fsdevel.vger.kernel.org J=F6rn Engel writes: > Two things. Until there are actual implementations of > s_op->wait_inodes, this is pure obfuscation. You already know this, > of course. On tux3, implementation of ->wait_inodes() is the following. Because tux3 guarantees order what wait_sb_inodes() wants to check, like data=3Djournal. +static void tux3_wait_inodes(struct super_block *sb) +{ + /* + * Since tux3 flushes whole delta and guarantee order of + * deltas, so tux3 doesn't need to wait inodes. + * + * Note, when we start to support direct I/O, we might have to + * revisit this to check in-progress direct I/O. + */ +} Another (untested) example for ext* would be like the following static void ext4_wait_inodes(struct super_block *sb) { /* ->sync_fs() guarantees to wait all */ if (test_opt(inode->i_sb, DATA_FLAGS) =3D=3D EXT4_MOUNT_JOURNAL_DATA) return; /* FIXME: On data=3Dordered, we might be able to do something. */ wait_sb_inodes(sb); } > More interestingly, I personally hate methods with a default option if > they are not implemented. Not too bad in this particular case, but > the same pattern has burned me a number of times and wasted weeks of > my life. So I would prefer to unconditionally call > sb->s_op->wait_inodes(sb) and set it to wait_sb_inodes for all > filesystems that don't have a smarter way to do things. I don't have strong opinion about it though. Because the optimized version is optional, this way might be safer. Well, if there is the reason to push down, I will do it. Thanks. -- = OGAWA Hirofumi