xfs
[Top] [All Lists]

Re: [PATCH 4/7] xfs: Sort delayed write buffers before dispatch

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 4/7] xfs: Sort delayed write buffers before dispatch
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 25 Jan 2010 07:00:54 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1264400564-19704-5-git-send-email-david@xxxxxxxxxxxxx>
References: <1264400564-19704-1-git-send-email-david@xxxxxxxxxxxxx> <1264400564-19704-5-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
> @@ -1937,42 +1967,46 @@ xfs_flush_buftarg(
>       xfs_buftarg_t   *target,
>       int             wait)
>  {
> -     struct list_head tmp;
> -     xfs_buf_t       *bp, *n;
> +     xfs_buf_t       *bp;
>       int             pincount = 0;
> +     LIST_HEAD(tmp_list);
> +     LIST_HEAD(wait_list);
>  
>       xfs_buf_runall_queues(xfsconvertd_workqueue);
>       xfs_buf_runall_queues(xfsdatad_workqueue);
>       xfs_buf_runall_queues(xfslogd_workqueue);
>  
>       set_bit(XBT_FORCE_FLUSH, &target->bt_flags);
> -     pincount = xfs_buf_delwri_split(target, &tmp, 0);
> +     pincount = xfs_buf_delwri_split(target, &tmp_list, 0);
>  
>       /*
> -      * Dropped the delayed write list lock, now walk the temporary list
> +      * Dropped the delayed write list lock, now walk the temporary list.
> +      * All I/O is issued async and then if we need to wait for completion
> +      * we do that after issuing all the IO.
>        */
> -     list_for_each_entry_safe(bp, n, &tmp, b_list) {
> +     list_sort(NULL, &tmp_list, xfs_buf_cmp);
> +     while (!list_empty(&tmp_list)) {
> +             struct xfs_buf *bp;

This now has a bp variable both in functionp-wide scope and a local one
here.  Might be worth to decide for either style.

Otherwise looks good,


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

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