Skip to content

Commit 07c5b9c

Browse files
committed
qed: put cond_resched() in qed_grc_dump_ctx_data()
jira LE-2177 Rebuild_History Non-Buildable kernel-5.14.0-503.19.1.el9_5 commit-author Michal Schmidt <[email protected]> commit 6cd6957 On a kernel with preemption none or voluntary, 'ethtool -d' on a qede network device can cause a big latency spike. The biggest part of it is the loop in qed_grc_dump_ctx_data. The function is called only from the .get_size and .perform_dump callbacks for the "grc" feature defined in qed_features_lookup[]. As far as I can see, they are used in: - qed's devlink healh reporter .dump op - qede's ethtool get_regs/get_regs_len/get_dump_data ops - qedf's qedf_get_grc_dump, called from: - qedf_sysfs_write_grcdump - "grcdump" sysfs attribute write - qedf_wq_grcdump - a workqueue It is safe to sleep in all of them. Let's insert a cond_resched() in the outer loop to let other tasks run. Measured using this script: #!/bin/bash DEV=ens3f1 echo wakeup_rt > /sys/kernel/tracing/current_tracer echo 0 > /sys/kernel/tracing/tracing_max_latency echo 1 > /sys/kernel/tracing/tracing_on echo "Setting the task CPU affinity" taskset -p 1 $$ > /dev/null echo "Starting the real-time task" chrt -f 50 bash -c 'while sleep 0.01; do :; done' & sleep 1 echo "Running: ethtool -d $DEV" time ethtool -d $DEV > /dev/null kill %1 echo 0 > /sys/kernel/tracing/tracing_on echo "Measured latency: $(</sys/kernel/tracing/tracing_max_latency) us" echo "To see the latency trace: less /sys/kernel/tracing/trace" The patch lowers the latency from 180 ms to 53 ms on my test system with voluntary preemption. Signed-off-by: Michal Schmidt <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 6cd6957) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 0d8d3ce commit 07c5b9c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/qlogic/qed/qed_debug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,6 +2872,7 @@ static u32 qed_grc_dump_ctx_data(struct qed_hwfn *p_hwfn,
28722872
false,
28732873
SPLIT_TYPE_NONE, 0);
28742874
}
2875+
cond_resched();
28752876
}
28762877

28772878
return offset;

0 commit comments

Comments
 (0)