[Top] [All Lists]

Re: du vs. ls

To: pille <pille+xfs+mailinglist+sgi@xxxxxxxxxxxx>
Subject: Re: du vs. ls
From: Matthias Schniedermeyer <ms@xxxxxxx>
Date: Fri, 4 Jan 2013 17:14:49 +0100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <50E6F6D4.5090407@xxxxxxxxxxxx>
References: <50E6F6D4.5090407@xxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On 04.01.2013 16:35, pille wrote:
> hi,
> # du -hs file copy
> 128M    file                     !!
> 100M    copy

I think you are bitten by "speculative preallocation".
When XFS "thinks" you will extent the file in the future it speculativly 
allocates space. This prevents fragmentation.

This fixes itself over time.
Either do enough IO that the cache of the copy gets reused or umount or 
"echo 3 > /proc/sys/vm/drop_caches"
(The last one drops the whole cache (except dirty pages) of Linux!)

If it is a problem, the behaviour can be disabled by using the 
mount-option "allocsize", for example: "allocsize=4k"



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