xfs
[Top] [All Lists]

Re: [PATCH] Remove l_flushsema

To: David Chinner <dgc@xxxxxxx>
Subject: Re: [PATCH] Remove l_flushsema
From: Matthew Wilcox <matthew@xxxxxx>
Date: Wed, 30 Apr 2008 04:24:17 -0600
Cc: xfs@xxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx
In-reply-to: <20080430090502.GH14976@parisc-linux.org>
References: <20080430090502.GH14976@parisc-linux.org>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
On Wed, Apr 30, 2008 at 03:05:03AM -0600, Matthew Wilcox wrote:
> @@ -2385,12 +2379,13 @@ restart:
>  
>       iclog = log->l_iclog;
>       if (! (iclog->ic_state == XLOG_STATE_ACTIVE)) {
> -             log->l_flushcnt++;
> +             DEFINE_WAIT(wait);
> +             prepare_to_wait(&log->l_flush_wq, &wait, TASK_UNINTERRUPTIBLE);
>               spin_unlock(&log->l_icloglock);
>               xlog_trace_iclog(iclog, XLOG_TRACE_SLEEP_FLUSH);
>               XFS_STATS_INC(xs_log_noiclogs);
> -             /* Ensure that log writes happen */
> -             psema(&log->l_flushsema, PINOD);
> +             /* Wait for log writes to have flushed */
> +             schedule();
>               goto restart;
>       }
>       ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE);

Christoph points out that this is missing a call to finish_wait() after
schedule() and he's absolutely right.  It only matters if the task was
woken up by something other than being on this wait queue, so my testing
didn't notice it missing.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."


<Prev in Thread] Current Thread [Next in Thread>