[patch 02/12] xfs: do exact log space wakeups in xlog_ungrant_log_space
Ben Myers
bpm at sgi.com
Thu Feb 16 12:36:59 CST 2012
On Mon, Dec 12, 2011 at 09:13:49AM -0500, Christoph Hellwig wrote:
> The only reason that xfs_log_space_wake had to do opportunistic wakeups
> was that the old xfs_log_move_tail calling convention didn't allow for
> exact wakeups when not updating the log tail LSN.
Man, that's a doosey.
when you called xfs_log_move_tail...
if you passed tail_lsn = 1
it would: not move the tail
ignore strict accounting and wake only 1
if you passed tail_lsn = 0
it would: get tail_lsn from l_last_sync_lsn
move the tail
pay attention to strict accounting
wake as many as is correct
if you passed tail_lsn = !1, !0
it would: move the tail
pay attention to strict accounting
wake as many as is correct.
The important thing to understand is that the opportunistic wakeups
would ignore the the test (free_bytes < need_bytes) in
xfs_log_move_tail, so you could wake a process regardless of whether
there is sufficient space in the log for it. No wonder they had to
pepper the code with opportunistic wakeups to prevent log space hangs...
> Since this issue has
> been fixed we can do exact wakeups now.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
>
> ---
> fs/xfs/xfs_log.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: xfs/fs/xfs/xfs_log.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_log.c 2011-12-11 15:30:49.977750776 +0100
> +++ xfs/fs/xfs/xfs_log.c 2011-12-11 17:49:00.692836117 +0100
> @@ -2748,7 +2748,7 @@ xlog_ungrant_log_space(xlog_t *log,
>
> trace_xfs_log_ungrant_exit(log, ticket);
>
> - xfs_log_space_wake(log->l_mp, true);
> + xfs_log_space_wake(log->l_mp, false);
Yeah, he's doing an _exact_ wakeup now.
Reviewed-by: Ben Myers <bpm at sgi.com>
More information about the xfs
mailing list