| To: | Dave Chinner <david@xxxxxxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 4/5] xfs: introduce background inode reclaim work |
| From: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
| Date: | Thu, 3 Mar 2011 10:36:34 -0500 |
| Cc: | xfs@xxxxxxxxxxx, chris.mason@xxxxxxxxxx |
| In-reply-to: | <1298412969-14389-5-git-send-email-david@xxxxxxxxxxxxx> |
| References: | <1298412969-14389-1-git-send-email-david@xxxxxxxxxxxxx> <1298412969-14389-5-git-send-email-david@xxxxxxxxxxxxx> |
| User-agent: | Mutt/1.5.21 (2010-09-15) |
> +void
> +xfs_syncd_queue_reclaim(
> + struct xfs_mount *mp,
> + int flags)
> +{
> + mutex_lock(&xfs_syncd_lock);
> + if (!delayed_work_pending(&mp->m_reclaim_work))
> + queue_delayed_work(xfs_syncd_wq, &mp->m_reclaim_work,
> + xfs_syncd_centisecs / 5 * msecs_to_jiffies(10));
> + mutex_unlock(&xfs_syncd_lock);
> +
> + if (flags & SYNC_WAIT)
> + flush_delayed_work_sync(&mp->m_reclaim_work);
> +}
queue_work/queue_delayed_work have a test_set_bit on
WORK_STRUCT_PENDING_BIT, so can just call queue_work/queue_delayed_work
and it will do the right thing if it is in use. So you can remove the
mutex and delayed_work_pending check here.
At least currently SYNC_WAIT is never set by any caller, and I wonder if
we should just leave the waiting to the caller if we ever grow one.
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [GIT PULL] XFS update for 2.6.38-rc8, Alex Elder |
|---|---|
| Next by Date: | Re: [PATCH 5/5] xfs: kick inode writeback when low on memory, Christoph Hellwig |
| Previous by Thread: | [GIT PULL] XFS update for 2.6.38-rc8, Alex Elder |
| Next by Thread: | Re: [PATCH 4/5] xfs: introduce background inode reclaim work, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |