]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: limit speculative prealloc near ENOSPC thresholds
authorDave Chinner <dchinner@redhat.com>
Mon, 21 Jan 2013 12:53:54 +0000 (23:53 +1100)
committerBen Myers <bpm@sgi.com>
Thu, 24 Jan 2013 17:08:55 +0000 (11:08 -0600)
commit8379b5b020dac5a02062cbeb94115d916a1232a7
treeeb3763d27fb430e0ba6d7d8e851efcfc47245176
parentbe18652592ad3ec1c46b2d3a27d31f5823094fc4
xfs: limit speculative prealloc near ENOSPC thresholds

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...

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_iomap.c