[PATCH 2/2] XFS: Don't wake xfsbufd when idle

Christoph Hellwig hch at infradead.org
Mon Jan 4 09:20:48 CST 2010


On Sat, Jan 02, 2010 at 01:43:35PM +1100, Dave Chinner wrote:
> The xfsbufd wakes every xfsbufd_centisecs (once per second by
> default) for each filesystem even when the filesystem is idle.
> If the xfsbufd has nothing to do, put it into a long term sleep
> and only wake it up when there is work pending (i.e. dirty
> buffers to flush soon). This will make laptop power misers happy.
> 
> Signed-off-by: Dave Chinner <david at fromorbit.com>
> ---
>  fs/xfs/linux-2.6/xfs_buf.c |   28 +++++++++++++++++++---------
>  1 files changed, 19 insertions(+), 9 deletions(-)
> 

>  STATIC int xfsbufd(void *);
> -STATIC int xfsbufd_wakeup(int, gfp_t);
> +STATIC int xfsbufd_wakeup_all(int, gfp_t);

this rename seems unrelated to the rest of the patch.

> @@ -1595,6 +1595,11 @@ xfs_buf_delwri_queue(
>  		list_del(&bp->b_list);
>  	}
>  
> +	if (list_empty(dwq)) {
> +		/* start xfsbufd as it has something to do now */
> +		wake_up_process(bp->b_target->bt_task);
> +	}

Does it make sense to wake xfsbufd before actually adding the item and
unlocking the queue lock?  Shouldn't this be defered until after the
addition?




More information about the xfs mailing list