Re: [PATCH] lib/raid6: fix abnormally high latency
From: Song Liu <song@kernel.org>
Date: 2021-12-18 09:02:03
Also in:
linux-rt-users, lkml
On Fri, Dec 17, 2021 at 1:43 PM Daniel Vacek [off-list ref] wrote:
Hello, This is perfectly correct and expected result. Further explanation follows down below. On Wed, Dec 15, 2021 at 8:41 PM [off-list ref] wrote:quoted
December 15, 2021 1:27 AM, "Song Liu" [off-list ref] wrote:quoted
On Mon, Dec 13, 2021 at 7:17 PM Yajun Deng [off-list ref] wrote:quoted
We found an abnormally high latency when executing modprobe raid6_pq, the latency is greater than 1.2s when CONFIG_PREEMPT_VOLUNTARY=y, greater than 67ms when CONFIG_PREEMPT=y, and greater than 16ms when CONFIG_PREEMPT_RT=y. This is caused by disable the preemption, this time is too long and unreasonable. We just need to disable migration. so used migrate_disable()/ migrate_enable() instead of preempt_disable()/preempt_enable(). This is beneficial for CONFIG_PREEMPT=y or CONFIG_PREEMPT_RT=y, but no effect for CONFIG_PREEMPT_VOLUNTARY=y. Fixes: fe5cbc6e06c7 ("md/raid6 algorithms: delta syndrome functions") Signed-off-by: Yajun Deng <redacted>We measure the speed of different RAID algorithms.If we don't disable preempt, the result may be inaccurate, right? IIUC, we only disable preempt for 16 jiffies. Why do we see 1.2 second delay?Here are the command of my test: Execute "sudo cyclictest -S -p 95 -d 0 -i 1000 -D 24h -m" in one terminal and "sudo modprobe raid6_pq" in the other terminal. Here are the results of my test: CONFIG_PREEMPT_VOLUNTARY=y,CONFIG_HZ_250=y T:17 ( 3109) P:95 I:1000 C: 7255 Min: 1 Act: 2 Avg: 170 Max: 1220832No preemption is expected with this config so the CPU is busy and occupied for full duration of all the benchmarks.quoted
CONFIG_PREEMPT=y,CONFIG_HZ_250=y T: 2 ( 2462) P:95 I:1000 C: 49024 Min: 1 Act: 2 Avg: 4 Max: 6788816 jiffies with 250 Hz equals to 64 ms. So again, this result is perfectly expected. The benchmarks can be preempted in between the individual measurements with preemptible kernel configuration.quoted
CONFIG_PREEMPT_RT=y,CONFIG_HZ_1000=y T: 6 ( 2561) P:95 I:1000 C: 25284 Min: 3 Act: 3 Avg: 4 Max: 1659316 jiffies by 1000 Hz is 16 ms. Ditto. So far so good.
Thanks for the explanation. I misread/misunderstood some of these results. I dropped the patch from md-next. Song