Date: Fri, 22 Sep 2017 17:46:42 +0200 From: Andreas Longwitz <longwitz@incore.de> To: Konstantin Belousov <kostikbel@gmail.com> Cc: Kirk McKusick <mckusick@mckusick.com>, freebsd-fs@freebsd.org Subject: Re: fsync: giving up on dirty on ufs partitions running vfs_write_suspend() Message-ID: <59C53062.5070709@incore.de> In-Reply-To: <20170922102917.GC2271@kib.kiev.ua> References: <201709110519.v8B5JVmf060773@chez.mckusick.com> <59BD0EAC.8030206@incore.de> <20170916183117.GF78693@kib.kiev.ua> <59C37F46.80509@incore.de> <20170921172902.GW78693@kib.kiev.ua> <59C4DF8D.5070004@incore.de> <20170922102917.GC2271@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov wroze: > On Fri, Sep 22, 2017 at 12:01:49PM +0200, Andreas Longwitz wrote: >> Patch against HEAD: > Of course I meant the patch which waits for secondary writers to pass. > >> --- vfs_default.c.orig 2017-09-22 11:56:26.950084000 +0200 >> +++ vfs_default.c 2017-09-22 11:58:33.211196000 +0200 >> @@ -690,6 +690,8 @@ >> bremfree(bp); >> bawrite(bp); >> } >> + if( maxretry < 1000) >> + DELAY(1000); /* 1 ms */ >> BO_LOCK(bo); >> goto loop2; >> } Excuse me, but I don't have a patch which waits for secondary writers to pass. As I posted before I have checked using a dtrace script, that the counter bo->bo_dirty.bv_cnt (which is used by the kernel) always goes to zero, when the secondary writes (as you explained: meaning number of threads in vn_start_secondary_write) goes to zero. To be exact: bo->bo_dirty.bv_cnt goes to zero one loop step later than mnt_secondary_writes. But without bumping up maxres or introducing some kind of DELAY we will sometimes trigger the "giving up on dirty" message. First of all I prefer to get rid of this message. Your proposal to check the secondary writes would be a further improvement of the code. -- Andreas Longwitz
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?59C53062.5070709>