public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] XFS: fix the description of 'allocsize=' mount option
@ 2014-02-24  6:04 sat
  2014-02-24 12:06 ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: sat @ 2014-02-24  6:04 UTC (permalink / raw)
  To: xfs, Rob Landley, Dave Chinner

From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>

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.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Rob Landley <rob@landley.net>
---
 Documentation/filesystems/xfs.txt |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt
index 5be51fd..30e57b0 100644
--- a/Documentation/filesystems/xfs.txt
+++ b/Documentation/filesystems/xfs.txt
@@ -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
-- 
1.7.1

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] XFS: fix the description of 'allocsize=' mount option
  2014-02-24  6:04 [PATCH] XFS: fix the description of 'allocsize=' mount option sat
@ 2014-02-24 12:06 ` Dave Chinner
  2014-02-26  4:38   ` sat
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2014-02-24 12:06 UTC (permalink / raw)
  To: sat; +Cc: Rob Landley, xfs

On Mon, Feb 24, 2014 at 03:04:21PM +0900, sat wrote:
> From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
> 
> 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.
> 
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Rob Landley <rob@landley.net>
> ---
>  Documentation/filesystems/xfs.txt |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt
> index 5be51fd..30e57b0 100644
> --- a/Documentation/filesystems/xfs.txt
> +++ b/Documentation/filesystems/xfs.txt
> @@ -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

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.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] XFS: fix the description of 'allocsize=' mount option
  2014-02-24 12:06 ` Dave Chinner
@ 2014-02-26  4:38   ` sat
  2014-02-27  6:42     ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: sat @ 2014-02-26  4:38 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Rob Landley, xfs

Hi Dave,

> 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 <takeuchi_satoru@jp.fujitsu.com>
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.

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Rob Landley <rob@landley.net>
---
  Documentation/filesystems/xfs.txt |    6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/filesystems/xfs.txt b/Documentation/filesystems/xfs.txt
index 5be51fd..5837f0a 100644
--- a/Documentation/filesystems/xfs.txt
+++ b/Documentation/filesystems/xfs.txt
@@ -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
-- 
1.7.1



_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] XFS: fix the description of 'allocsize=' mount option
  2014-02-26  4:38   ` sat
@ 2014-02-27  6:42     ` Dave Chinner
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2014-02-27  6:42 UTC (permalink / raw)
  To: sat; +Cc: Rob Landley, xfs

On Wed, Feb 26, 2014 at 01:38:59PM +0900, sat wrote:
> Hi Dave,
> 
> >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 <takeuchi_satoru@jp.fujitsu.com>
> 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.
> 
> Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Rob Landley <rob@landley.net>

Looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-27  6:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24  6:04 [PATCH] XFS: fix the description of 'allocsize=' mount option sat
2014-02-24 12:06 ` Dave Chinner
2014-02-26  4:38   ` sat
2014-02-27  6:42     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox