Whamcloud - gitweb
LU-12219 obdfilter: changes PAGE_SIZE variable 54/34754/3
authorAlexander Boyko <c17825@cray.com>
Wed, 24 Apr 2019 14:14:57 +0000 (10:14 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 7 Jun 2019 04:08:23 +0000 (04:08 +0000)
obdfilter-survey uses PAGE_SIZE in KBytes. After LU-11597
PAGE_SIZE exported from test-framework.sh in bytes. So it confuses
obdfilter-survey and lead to error:
/usr/bin/obdfilter-survey: line 509: size * 1024 / (actual_rsz * thr):
division by 0 (error token is ")")

Patch changes the name to PAGE_SIZE_KB.

Fixes: f602b5ec7f4 ("LU-11597 tests: fix O_DIRECT test usage for ARM")
Test-Parameters: trivial testlist=obdfilter-survey
Signed-off-by: Alexander Boyko <c17825@cray.com>
Cray-bug-id: LUS-7214
Change-Id: Ie8be852c9634569c59a770ba49c3d1c36f53fdb2
Reviewed-on: https://review.whamcloud.com/34754
Reviewed-by: Elena Gryaznova <c17455@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre-iokit/obdfilter-survey/obdfilter-survey

index 382db0c..adb5b6b 100755 (executable)
@@ -310,8 +310,8 @@ restart_thr=1
 restart_nobj=1
 
 # machine's page size (KB)
-PAGE_SIZE=${PAGE_SIZE:-$(($(getconf PAGE_SIZE) / 1024))}
-PAGE_SIZE=${PAGE_SIZE:-4}
+PAGE_SIZE_KB=${PAGE_SIZE_KB:-$(( ${PAGE_SIZE:-$(getconf PAGE_SIZE)} / 1024))}
+PAGE_SIZE_KB=${PAGE_SIZE_KB:-4}
 
 snap=1
 clean_srv_OSS=0
@@ -504,8 +504,8 @@ for ((rsz = $rszlo; rsz <= $rszhi; rsz*=2)); do
                        # compute parameters
                        total_thr=$((ndevs * thr))
                        total_nobj=$((ndevs * nobj))
-                       pages=$((rsz / PAGE_SIZE))
-                       actual_rsz=$((pages * PAGE_SIZE))
+                       pages=$(( (rsz + PAGE_SIZE_KB - 1) / PAGE_SIZE_KB))
+                       actual_rsz=$((pages * PAGE_SIZE_KB))
                        count=$((size * 1024 / (actual_rsz * thr)))
                        actual_size=$((actual_rsz * count * thr))
                        total_size=$((actual_size * ndevs))