Livelock / softdep_flush "loop"
Tor Egge
Tor.Egge at cvsup.no.freebsd.org
Mon Apr 3 21:04:09 UTC 2006
> 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
More information about the freebsd-current
mailing list