RE: [PATCH] rtase: Avoid sleeping in get_stats64()

From
Justin Lai <justinlai0215@realtek.com>
Date
2026-06-02 11:00:34
Also in
lkml
Reply to
Alexander Lobakin, 2026-06-01
From: Justin Lai <justinlai0215@realtek.com>
Date: Mon, 1 Jun 2026 14:24:47 +0800
quoted
The .ndo_get_stats64 callback must not sleep because it can be called
when reading /proc/net/dev.

rtase_get_stats64() calls rtase_dump_tally_counter(), which polls the
tally counter dump bit with read_poll_timeout(). This may sleep while
waiting for the hardware counter dump to complete.

Use read_poll_timeout_atomic() instead to avoid sleeping in the
get_stats64() path.

Signed-off-by: Justin Lai <justinlai0215@realtek.com>
Looks legit.

One question: for how long can this poll for in real life scenarios? Up to ~1 ms
is okay-ish for atomic, but if longer, then you'd better to split it into shorter
polls and reschedule() time to time.

Thanks,
Olek
Hi Olek,
 
Thanks for the review.
 
On our test platform, the tally dump operation typically
completes in about 25 us. The 250 us timeout is a
conservative value.
 
I'll add the Fixes tag and resend this patch targeting
the net tree.
 
Thanks,
Justin
Thread (9 messages) 9 messages, 4 authors, last reply 2026-06-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help