Skip to contentSkip to conversation

XFS: fix the description of 'allocsize=' mount option

PATCH In review sat 2 participants 4 messages Feb 24, 2014 – Feb 27, 2014 Documentation

lore
Share & tools
lore

sat

author
#0 lore raw

PATCH 1/1 XFS: fix the description of 'allocsize=' mount option

From: Satoru Takeuchi <[email protected]>

The end-of-file preallocation size is dynamic by default. So the description about the default size of preallocation should be removed.

Instead, adding the description about the initial size of dynamic preallocation is useful for users.

Cc Dave Chinner <[email protected]>
Cc Rob Landley <[email protected]>
---
 Documentation/filesystems/xfs.txt |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
Documentation/filesystems/xfs.txt +8 -8
index 5be51fd..30e57b0 100644
@@ -23,16 +23,16 @@ default behaviour.
 
   allocsize=size
 	Sets the buffered I/O end-of-file preallocation size when
-	doing delayed allocation writeout (default size is 64KiB).
-	Valid values for this option are page size (typically 4KiB)
-	through to 1GiB, inclusive, in power-of-2 increments.
+	doing delayed allocation writeout. Valid values for this
+	option are page size (typically 4KiB) through to 1GiB,
+	inclusive, in power-of-2 increments.
 
 	The default behaviour is for dynamic end-of-file
-	preallocation size, which uses a set of heuristics to
-	optimise the preallocation size based on the current
-	allocation patterns within the file and the access patterns
-	to the file. Specifying a fixed allocsize value turns off
-	the dynamic behaviour.
+	preallocation size (initial size is 64KiB), which uses a
+	set of heuristics to optimise the preallocation size based
+	on the current allocation patterns within the file and
+	the access patterns to the file. Specifying a fixed
+	allocsize value	turns off the dynamic behaviour.
 
   attr2
   noattr2
Signature · 6 lines
1.7.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 28 lines · sat

From: Satoru Takeuchi <[email protected]>

The end-of-file preallocation size is dynamic by default. So the description about the default size of preallocation should be removed.

Instead, adding the description about the initial size of dynamic preallocation is useful for users.

Cc Dave Chinner <[email protected]>
Cc Rob Landley <[email protected]>
---
 Documentation/filesystems/xfs.txt |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
Documentation/filesystems/xfs.txt +1 -3
index 5be51fd..30e57b0 100644
@@ -23,16 +23,16 @@ default behaviour.
 
   allocsize=size
 	Sets the buffered I/O end-of-file preallocation size when
-	doing delayed allocation writeout (default size is 64KiB).
-	Valid values for this option are page size (typically 4KiB)
-	through to 1GiB, inclusive, in power-of-2 increments.
+	doing delayed allocation writeout. Valid values for this

Documentation/filesystems/xfs.txt default behaviour. · line 31

Quoted 10 lines
Documentation/filesystems/xfs.txt +3 -5
+	option are page size (typically 4KiB) through to 1GiB,
+	inclusive, in power-of-2 increments.
 
 	The default behaviour is for dynamic end-of-file
-	preallocation size, which uses a set of heuristics to
-	optimise the preallocation size based on the current
-	allocation patterns within the file and the access patterns
-	to the file. Specifying a fixed allocsize value turns off
-	the dynamic behaviour.
+	preallocation size (initial size is 64KiB), which uses a

Actually, it isn't. The initial size of dynamic prealloc is determined by a set of heuristics based on file size, filesystem geometry and the existing extents on the file. It uses a default of 64k if no optimisation heuristics trigger.

Therefore, it may actually be zero - we don't do any speculative preallocation for small files until they grow past a specific threshold. i.e. there is a small file optimisation heuristic that takes precendence over the default, and so the comment about the initial prealloc size being 64k is wrong. The initial prealloc size is zero....

An example at the other end of the spectrumL we preallocate a chunk of a file, then write past the end of the preallocated region. The initial speculative preallocation is triggered once we pass the preallocated region, and the heuristics can result in an initial size anywhere in the range of zero (small file) to 2^21 blocks (large, multi-GB file).

Hence I think that the generalised text saying "default is 64k and is optimised based on heuristics" reflects the behaviour of the algorithm much better than saying "<algorithmic heuristic> and is optimised by algorithmic heuristics"....

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
author
#2 lore raw

Hi Dave,

Quoted 4 lines

Actually, it isn't. The initial size of dynamic prealloc is determined by a set of heuristics based on file size, filesystem geometry and the existing extents on the file. It uses a default of 64k if no optimisation heuristics trigger.

I see. I should have read the code more carefully.

---
From: Satoru Takeuchi <[email protected]>
Subject: [PATCH] XFS: remove the description about the default value of "allocsize=" mount option

The end-of-file preallocation size is dynamic by default. So there is no static default size specified by "allocsize=" mount option and the description about the default size should be removed.

Cc Dave Chinner <[email protected]>
Cc Rob Landley <[email protected]>
---
 Documentation/filesystems/xfs.txt |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Documentation/filesystems/xfs.txt +3 -3
index 5be51fd..5837f0a 100644
@@ -23,9 +23,9 @@ default behaviour.
 
   allocsize=size
     Sets the buffered I/O end-of-file preallocation size when
-    doing delayed allocation writeout (default size is 64KiB).
-    Valid values for this option are page size (typically 4KiB)
-    through to 1GiB, inclusive, in power-of-2 increments.
+    doing delayed allocation writeout. Valid values for this
+    option are page size (typically 4KiB) through to 1GiB,
+    inclusive, in power-of-2 increments.
 
     The default behaviour is for dynamic end-of-file
     preallocation size, which uses a set of heuristics to
Signature · 8 lines
1.7.1



_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by
#3 lore raw
Quoted 13 lines · sat

Hi Dave,

Quoted 4 lines

Actually, it isn't. The initial size of dynamic prealloc is determined by a set of heuristics based on file size, filesystem geometry and the existing extents on the file. It uses a default of 64k if no optimisation heuristics trigger.

I see. I should have read the code more carefully.

---
From: Satoru Takeuchi <[email protected]>
Subject: [PATCH] XFS: remove the description about the default value of "allocsize=" mount option

Quoted 8 lines

The end-of-file preallocation size is dynamic by default. So there is no static default size specified by "allocsize=" mount option and the description about the default size should be removed.

Cc Dave Chinner <[email protected]>
Cc Rob Landley <[email protected]>

Looks good.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs