xfs
[Top] [All Lists]

Re: [PATCH 5/6] xfs: convert the xfsaild threads to a workqueue

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 5/6] xfs: convert the xfsaild threads to a workqueue
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 18 Mar 2011 15:06:48 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20110310174818.GE19609@xxxxxxxxxxxxx>
References: <1299715529-11026-1-git-send-email-david@xxxxxxxxxxxxx> <1299715529-11026-6-git-send-email-david@xxxxxxxxxxxxx> <20110310174818.GE19609@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Thu, Mar 10, 2011 at 12:48:18PM -0500, Christoph Hellwig wrote:
> >  STATIC int __init
> > +xfs_init_workqueues(void)
> 
> > +STATIC void __exit
> > +xfs_destroy_workqueues(void)
> 
> I don't think these helpers are overly useful.

I'm thinking of adding a few more workqueues, so I though I'd split
them out like zone initialisation at the outset....

> 
> > +   xfs_ail_wq = alloc_workqueue("xfsail", WQ_CPU_INTENSIVE, 8);
> 
> > +}
> 
> 
> > +static void
> > +xfs_ail_push_queue(
> > +   struct xfs_ail          *ailp,
> > +   xfs_lsn_t               threshold_lsn,
> > +   int                     tout)
> > +{
> > +   if (XFS_LSN_CMP(threshold_lsn, ailp->xa_target) > 0) {
> > +           ailp->xa_target = threshold_lsn;
> > +           queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, tout);
> 
> tout is always one in the only caller and thus doesn't need to be
> passed.  But I think you really want a timeout of 0 here to queue it up
> ASAP (it translates to a direct queue_work() call internally).
> 
> Also this function could simply be merged into it's only and relatively
> simple caller.

It gets used by a second caller in the next patch that uses a
timeout of zero. The idea of adding a delay to a normal push is to
rate limit the number of times we do work so we always work on
batches rather a few items at a time in multiple executions of the
work.

I'll see if it's simpler to just do this work directly in teh
callers, though.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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