[LU-9116] overflow of bandwidth caculation at crypto alg test Created: 14/Feb/17  Updated: 09/May/17  Resolved: 18/Mar/17

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.10.0

Type: Bug Priority: Minor
Reporter: Gu Zheng (Inactive) Assignee: Emoly Liu
Resolution: Fixed Votes: 0
Labels: cea, patch

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

In our production, we can get more bcount with crc32c crypto alg, but the test program report really bad bandwidth of it as following (with debug patch):
[42080.712841] bcount=1942, buf_len=1048576, j_start=4338031978, j_end=4338032978, jiffies_to_msecs(end - start):1000
[42080.712843] Crypto hash algorithm adler32 speed = 1941 MB/s
[42081.712632] bcount=10633, buf_len=1048576, j_start=4338032978, j_end=4338033978, jiffies_to_msecs(end - start):1000
[42081.712634] Crypto hash algorithm crc32 speed = 2440 MB/s
[42082.714242] bcount=462, buf_len=1048576, j_start=4338033978, j_end=4338034979, jiffies_to_msecs(end - start):1001
[42082.714244] Crypto hash algorithm md5 speed = 461 MB/s
[42083.713626] bcount=693, buf_len=1048576, j_start=4338034979, j_end=4338035979, jiffies_to_msecs(end - start):1000
[42083.713628] Crypto hash algorithm sha1 speed = 692 MB/s
[42084.715960] bcount=282, buf_len=1048576, j_start=4338035979, j_end=4338036981, jiffies_to_msecs(end - start):1002
[42084.715963] Crypto hash algorithm sha256 speed = 281 MB/s
[42085.716777] bcount=390, buf_len=1048576, j_start=4338036981, j_end=4338037982, jiffies_to_msecs(end - start):1001
[42085.716779] Crypto hash algorithm sha384 speed = 389 MB/s
[42086.717483] bcount=390, buf_len=1048576, j_start=4338037982, j_end=4338038983, jiffies_to_msecs(end - start):1001
[42086.717485] Crypto hash algorithm sha512 speed = 389 MB/s
[42087.717192] bcount=12562, buf_len=1048576, j_start=4338038983, j_end=4338039983, jiffies_to_msecs(end - start):1000
[42087.717194] Crypto hash algorithm crc32c speed = 273 MB/s

That's because bcount and buf_len are both int, and no force convert in the caculation code:
tmp = ((bcount * buf_len / jiffies_to_msecs(end - start)) *
1000) / (1024 * 1024);



 Comments   
Comment by Gerrit Updater [ 14/Feb/17 ]

Gu Zheng (gzheng@ddn.com) uploaded a new patch: https://review.whamcloud.com/25436
Subject: LU-9116 libcfs: avoid overflow of crypto bandwidth caculation
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f80b5d34adb87cbbb84705d31a1badb196441a71

Comment by Peter Jones [ 14/Feb/17 ]

Emoly

Could you please review this patch?

Thanks

Peter

Comment by Gerrit Updater [ 01/Mar/17 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch https://review.whamcloud.com/25436/
Subject: LU-9116 libcfs: avoid overflow of crypto bandwidth caculation
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 0c8d53e17be600c99e4a8f96062f39306c3ccad8

Comment by Peter Jones [ 18/Mar/17 ]

Landed for 2.10

Generated at Sat Feb 10 02:23:22 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.