xfs
[Top] [All Lists]

Re: [PATCH 6/6] xfs: convert xfsbufd to use a workqueue

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH 6/6] xfs: convert xfsbufd to use a workqueue
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 26 Aug 2011 10:18:24 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20110825234656.GS3162@dastard>
References: <1314256626-11136-1-git-send-email-david@xxxxxxxxxxxxx> <1314256626-11136-7-git-send-email-david@xxxxxxxxxxxxx> <1314305839.3136.104.camel@doink> <20110825234656.GS3162@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Aug 26, 2011 at 09:46:56AM +1000, Dave Chinner wrote:
> On Thu, Aug 25, 2011 at 03:57:19PM -0500, Alex Elder wrote:
> > On Thu, 2011-08-25 at 17:17 +1000, Dave Chinner wrote:
> > > +/*
> > > + * Flush all the queued buffer work, then flush any remaining dirty 
> > > buffers
> > > + * and wait for them to complete. If there are buffers remaining on the 
> > > delwri
> > > + * queue, then they were pinned so couldn't be flushed. Return a value 
> > > of 1 to
> > > + * indicate that there were pinned buffers and the caller needs to retry 
> > > the
> > > + * flush.
> > > + */
> > > +int
> > > +xfs_flush_buftarg(
> > > + xfs_buftarg_t   *target,
> > > + int             wait)
> > 
> > Since this function now ignores its "wait" argument,
> > you could eliminate it, and perhaps get rid of the
> > one (first) call in xfs_quiesce_fs() that passes 0.
> 
> I'll leave that to a another patch.

Actually, I'll re-instate the existing wait semantics here.

In looking at this again I realised there is a race condition in the
flushing code - if work is already in progress, then the wq flush
won't start new work and hence won't see the force flag at all. So
the code needs changing anyway and the only time we need to set the
FORCE_FLUSH flag is when we are supposed to be waiting. Hence I'll
change it back to doing a non-blocking flush when the wait flag is
not set.

If we want to go to just a blocking flush, then we can change
everything in the one patch.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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