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
|