xfs
[Top] [All Lists]

Re: [PATCH 3/4] xfs: limit speculative prealloc near ENOSPC thresholds

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 3/4] xfs: limit speculative prealloc near ENOSPC thresholds
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 22 Jan 2013 09:33:10 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1358772835-21436-4-git-send-email-david@xxxxxxxxxxxxx>
References: <1358772835-21436-1-git-send-email-david@xxxxxxxxxxxxx> <1358772835-21436-4-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0
On 01/21/2013 07:53 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> There is a window on small filesytsems where specualtive
> preallocation can be larger than that ENOSPC throttling thresholds,
> resulting in specualtive preallocation trying to reserve more space
> than there is space available. This causes immediate ENOSPC to be
> triggered, prealloc to be turned off and flushing to occur. One the
> next write (i.e. next 4k page), we do exactly the same thing, and so
> effective drive into synchronous 4k writes by triggering ENOSPC
> flushing on every page while in the window between the prealloc size
> and the ENOSPC prealloc throttle threshold.
> 
> Fix this by checking to see if the prealloc size would consume all
> free space, and throttle it appropriately to avoid premature
> ENOSPC...
> 

Would this alternatively be resolved by the updated throttling code that
is part of my quota prealloc throttling set? I'm referring to the
following patch in particular:

http://oss.sgi.com/archives/xfs/2013-01/msg00003.html

Brian

> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_iomap.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
> index 3587772..de3bad5 100644
> --- a/fs/xfs/xfs_iomap.c
> +++ b/fs/xfs/xfs_iomap.c
> @@ -395,6 +395,15 @@ xfs_iomap_prealloc_size(
>               }
>               if (shift)
>                       alloc_blocks >>= shift;
> +
> +             /*
> +              * If we are still trying to allocate more space than is
> +              * available, squash the prealloc hard. This can happen if we
> +              * have a large file on a small filesystem and the above
> +              * lowspace thresholds are smaller than MAXEXTLEN.
> +              */
> +             while (alloc_blocks >= freesp)
> +                     alloc_blocks >>= 4;
>       }
>  
>       if (alloc_blocks < mp->m_writeio_blocks)
> 

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