On Thu, Sep 05, 2019 at 08:48:53AM -0700, Darrick J. Wong wrote: > On Thu, Sep 05, 2019 at 06:47:16PM +1000, Dave Chinner wrote: > > From: Dave Chinner <dchinner@xxxxxxxxxx> > > > > xlog_state_clean_log() is only called from one place, and it occurs > > when an iclog is transitioning back to ACTIVE. Prior to calling > > xlog_state_clean_log, the iclog we are processing has a hard coded > > state check to DIRTY so that xlog_state_clean_log() processes it > > correctly. We also have a hard coded wakeup after > > xlog_state_clean_log() to enfore log force waiters on that iclog > > are woken correctly. > > > > Both of these things are operations required to finish processing an > > iclog and return it to the ACTIVE state again, so they make little > > sense to be separated from the rest of the clean state transition > > code. > > > > Hence push these things inside xlog_state_clean_log(), document the > > behaviour and rename it xlog_state_clean_iclog() to indicate that > > it's being driven by an iclog state change and does the iclog state > > change work itself. > > > > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx> > > Reviewed-by: Christoph Hellwig <hch@xxxxxx> > > --- > > fs/xfs/xfs_log.c | 57 ++++++++++++++++++++++++++++-------------------- > > 1 file changed, 33 insertions(+), 24 deletions(-) > > > > diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c > > index 356204ddf865..bef314361bc4 100644 > > --- a/fs/xfs/xfs_log.c > > +++ b/fs/xfs/xfs_log.c > > @@ -2521,21 +2521,35 @@ xlog_write( > > ***************************************************************************** > > */ > > > > -/* Clean iclogs starting from the head. This ordering must be > > - * maintained, so an iclog doesn't become ACTIVE beyond one that > > - * is SYNCING. This is also required to maintain the notion that we use > > - * a ordered wait queue to hold off would be writers to the log when every > > - * iclog is trying to sync to disk. > > +/* > > + * An iclog has just finished it's completion processing, so we need to update > > it's -> its, but I can fix that on import. Fixed - "just finished IO completion processing"... -Dave. -- Dave Chinner david@xxxxxxxxxxxxx