Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Apr 2006 21:04:03 +0000 (UTC)
From:      Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
To:        peter@holm.cc
Cc:        truckman@freebsd.org, current@freebsd.org
Subject:   Re: Livelock / softdep_flush "loop"
Message-ID:  <20060403.210403.74745739.Tor.Egge@cvsup.no.freebsd.org>
In-Reply-To: <20060403192808.GA91475@peter.osted.lan>
References:  <20060402190910.GA12759@peter.osted.lan> <20060402.204851.78799557.Tor.Egge@cvsup.no.freebsd.org> <20060403192808.GA91475@peter.osted.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060403.210403.74745739.Tor.Egge>