[Top] [All Lists]

Re: XFS Preallocate using ALLOCSP

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: XFS Preallocate using ALLOCSP
From: Smit Shah <getsmit@xxxxxxxxx>
Date: Tue, 16 Jun 2009 00:34:17 -0700
Cc: linux-xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=2fGQVNcSXLcDe3nriUUkLnukbZ9whiATagqQCLNwnSc=; b=k+B9lp2QsEwuZ2kpgqMtA0RaF9gnt0EtgMa2stx2xNkNwjYwVCn/TqWzDi0Ex3RDeo /OdQ31K8B9O9NjUZk1dMYVcz4Z80rfz5eMc8gDIDJtfrgPX+3l0iZeW0sba2khdc1/J0 4vm4OMP4NND1YOc+1jwhIVSOmhoeo/GrPHzjI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=TNaH2ClL8MH3FTwWLSkEZ3KQWYmq/nrvsxchR3pzlVmCnTmF39bPPrTOWZoq+3990t Fxx+rYhg38Jpxaf+C4jZYa51OV3YZhe0gfCzLzCY0rD6kDXhOCEgSNSIPKDVv0qmjPGW C0Fe8mYCmXZc3hzcZ9VuBI/IrM/ZaDn9vFGoU=
In-reply-to: <8770d98c0906152344p185533a9rc144a5667d13d2de@xxxxxxxxxxxxxx>
References: <24042506.post@xxxxxxxxxxxxxxx> <4A3712BF.7030101@xxxxxxxxxxx> <8770d98c0906152344p185533a9rc144a5667d13d2de@xxxxxxxxxxxxxx>

On Mon, Jun 15, 2009 at 11:44 PM, Smit Shah <getsmit@xxxxxxxxx> wrote:

On Mon, Jun 15, 2009 at 8:34 PM, Eric Sandeen <sandeen@xxxxxxxxxxx> wrote:
Smit Shah wrote:
> Hi,
> I wanted to preallocate the file using the ALLOCSP so that the preallocated
> space is zeroed out. Hence i used the xfsctl but the problem is that i
> cannot execute  it as a non-root user.  So i tried using fallocate but when
> i saw the xfs implementation of kernel it uses the RESVP cmd and  since the
> unwritten flag is set i am assuming that the performance of writing to the
> preallocated space will suffer because of the metadata updates. So is there
> a way to preallocate using ALLOCSP as a non-root user or else i would be
> required to modify the kernel ??
> TIA,
> Smit

ALLOCSP simply writes 0s to a file.... you may as well do it using posix
calls, as a normal user, I think.

Even the man page of fallocate says that it allocates and initializes to zero the disk space allocated but when i saw the code i did found out that it does not zero it out.  Hence was a kindof confused. So posix_allocate is similar to ALLOCSP when falloc is not supported by the underlying filesystem  that is to ftruncate the file  and zero it out. So all of them try to allocate contiguous blocks but the only difference is when we use the fallocate in ext4/xfs it does not zero out the preallocated space. Am i right ? 
I guess i am not right here ftruncate simply does a lseek and wirtes to it which might not be contiguous whereas fallocate tries to allocate contiguous block so as to reduce fragmentation and hence i thought to reduce fragmentation and for security reasons its better to use ALLOCSP rather than something like ftruncate /posix_fallocate or RSEVSP which kindof performs bad for writes with unwritten flag set and now there being a no direct way while creating the fs to disable unwritten. 
But  when i fallocate in ext4 i can see the write performance improvement but not in xfs and reason i found out in one of your previous comments is  because of the unwritten flag set in xfs. So how do we see if the unwritten flag is set or not ? I did use xfs_info but it didnt show any such information.  



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