Re: Livelock / softdep_flush "loop"

From: Tor Egge <Tor.Egge_at_cvsup.no.freebsd.org>
Date: Mon, 03 Apr 2006 21:04:03 +0000 (UTC)
> I ran the same test with your first patch for two hours and your
> second patch for 7 hours, without seeing any livelocks.

> 
> I added snapshots to the test and still did not get any livelocks, but
> I'm not certain that this last test covers your change.

On third thought, the second patch is probably not necessary.

The calls to process_worklist_item() with LK_NOWAIT as flags has to be inside
regions protected by vn_start_write()/vn_finished_write() or
vn_start_secondary_write()/vn_finished_secondary_write() since the calling
functions (ffs_alloc(), ffs_realloccg(), newdirrem(),
softdep_setup_freeblocks(), softdep_setup_directory_add(),
softdep_setup_directory_change(), softdep_change_linkcnt()) involve write
operations.  I did not take that into account when I had second thoughts about
the first patch.

vfs_write_suspend() sleeps until noone is inside regions protected by
vn_start_write()/vn_finished_write() for that file system before calling
VFS_SYNC().

softdep_check_suspend() sleeps until noone is inside regions protected by
vn_start_secondary_write()/vn_finished_secondary_write() for that file system.

Thus, with the first patch applied, ump->softdep_on_worklist_inprogress will
always be zero when softdep_check_suspend() returns.

- Tor Egge
Received on Mon Apr 03 2006 - 19:04:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:54 UTC