]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mshv: Use kfree_rcu in mshv_portid_free
authorStanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Wed, 22 Jul 2026 23:56:46 +0000 (23:56 +0000)
committerWei Liu <wei.liu@kernel.org>
Fri, 31 Jul 2026 20:01:43 +0000 (20:01 +0000)
mshv_portid_free() uses synchronize_rcu() followed by kfree() to
reclaim port table entries. This blocks the caller until a full RCU
grace period elapses, which is unnecessary since the same module already
uses the non-blocking kfree_rcu() pattern in mshv_port_table_fini().

Replace with kfree_rcu() to avoid the blocking wait and keep the
reclamation strategy consistent across the file.

Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
drivers/hv/mshv_portid_table.c

index 6f59b3e37624738768f05e842cc510c6d26dfbc5..0d632507ed2144a96bf81a4eb895eb1ce1640fd5 100644 (file)
@@ -62,8 +62,7 @@ mshv_portid_free(int port_id)
        WARN_ON(!info);
        idr_unlock(&port_table_idr);
 
-       synchronize_rcu();
-       kfree(info);
+       kfree_rcu(info, portbl_rcu);
 }
 
 int