From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH] Remove l_flushsema Date: Wed, 30 Apr 2008 04:24:17 -0600 Message-ID: <20080430102417.GK14976@parisc-linux.org> References: <20080430090502.GH14976@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: xfs@oss.sgi.com, linux-fsdevel@vger.kernel.org To: David Chinner Return-path: Received: from palinux.external.hp.com ([192.25.206.14]:51056 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbYD3KYS (ORCPT ); Wed, 30 Apr 2008 06:24:18 -0400 Content-Disposition: inline In-Reply-To: <20080430090502.GH14976@parisc-linux.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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."