Re: [PATCH v2] neighbour: Don't let neigh_forced_gc() disable preemption for long

From: Doug Anderson
Date: Wed Dec 06 2023 - 12:21:51 EST


Hi,

On Tue, Dec 5, 2023 at 7:39 PM Judy Hsiao <judyhsiao@xxxxxxxxxxxx> wrote:
>
> We are seeing cases where neigh_cleanup_and_release() is called by
> neigh_forced_gc() many times in a row with preemption turned off.
> When running on a low powered CPU at a low CPU frequency, this has
> been measured to keep preemption off for ~10 ms. That's not great on a
> system with HZ=1000 which expects tasks to be able to schedule in
> with ~1ms latency.
>
> Suggested-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
> Signed-off-by: Judy Hsiao <judyhsiao@xxxxxxxxxxxx>
>
> ---
>
> Changes in v2:
> - Use ktime_get_ns() for timeout calculation instead of jiffies.
>
> net/core/neighbour.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)

Though as evidenced by the discussion in v1 I'm not versed enough in
this code for it to mean much, the patch nonetheless looks reasonable
to me. I'm happy enough with:

Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>