public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmthin: express low_water in cluster_size not sector size
@ 2016-06-20  4:53 Eryu Guan
  2016-06-22  0:03 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Eryu Guan @ 2016-06-20  4:53 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

I noticed that thin-pool sent out "reached low water mark for data
device" event even before thin-pool device was mounted in
generic/347, this is because low water mark was set to a too high
value.

According to kernel thin-provisioning.txt documentation, low water
mark should be expressed in blocks of $cluster_size, not in sectors.

"$low_water_mark is expressed in blocks of size $data_block_size."

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 common/dmthin | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/dmthin b/common/dmthin
index 1b5c856..3cd206a 100644
--- a/common/dmthin
+++ b/common/dmthin
@@ -91,6 +91,8 @@ _dmthin_init()
 	if [ -z "$low_water" ]; then
 		low_water=204800	# 100M, in sectors
 	fi
+	# low_water is expressed in blocks of size $cluster_size
+	low_water=$((low_water / cluster_size))
 
 	# Need to make linear metadata and data devs.  From kernel docs:
 	# As a guide, we suggest you calculate the number of bytes to use in the
-- 
2.5.5


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

* Re: [PATCH] dmthin: express low_water in cluster_size not sector size
  2016-06-20  4:53 [PATCH] dmthin: express low_water in cluster_size not sector size Eryu Guan
@ 2016-06-22  0:03 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2016-06-22  0:03 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

On Mon, Jun 20, 2016 at 12:53:06PM +0800, Eryu Guan wrote:
> I noticed that thin-pool sent out "reached low water mark for data
> device" event even before thin-pool device was mounted in
> generic/347, this is because low water mark was set to a too high
> value.
> 
> According to kernel thin-provisioning.txt documentation, low water
> mark should be expressed in blocks of $cluster_size, not in sectors.
> 
> "$low_water_mark is expressed in blocks of size $data_block_size."
> 
> Signed-off-by: Eryu Guan <eguan@redhat.com>

Looks good.

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

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

end of thread, other threads:[~2016-06-22  0:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-20  4:53 [PATCH] dmthin: express low_water in cluster_size not sector size Eryu Guan
2016-06-22  0:03 ` Dave Chinner

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