vdpa/mlx5: fix polling threads scheduling
authorMatan Azrad <matan@nvidia.com>
Mon, 8 Feb 2021 09:28:01 +0000 (09:28 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 10 Feb 2021 21:17:47 +0000 (22:17 +0100)
commitb7fa0bf4d5c659f43d012f66b748d0f4c3d26b90
tree15751a2f00a0b6d87a68d9db01fc8797e2133e49
parent894028ace2c5af2506897898f407cbdf24cef0c5
vdpa/mlx5: fix polling threads scheduling

When the event mode is with 0 fixed delay, the polling-thread will never
give-up CPU.

So, when multi-polling-threads are active, the context-switch between
them will be managed by the system which may affect latency according to
the time-out decided by the system.

In order to fix multi-devices polling thread scheduling, this patch
forces rescheduling for each CQ poll iteration.

Move the polling thread to SCHED_RR mode with maximum priority to
complete the fairness.

Fixes: 6956a48cabbb ("vdpa/mlx5: set polling mode default delay to zero")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
drivers/vdpa/mlx5/mlx5_vdpa_event.c