Instead of invoking a synchronize_rcu() to free a pointer after a grace period we can directly make use of new API that does the same but in more efficient way. CC: Steven Rostedt <rostedt@xxxxxxxxxxx> Signed-off-by: Uladzislau Rezki (Sony) <urezki@xxxxxxxxx> --- arch/x86/mm/mmio-mod.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index 933a2ebad471..e75137a06c32 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -307,10 +307,8 @@ static void iounmap_trace_core(volatile void __iomem *addr) not_enabled: spin_unlock_irq(&trace_lock); - if (found_trace) { - synchronize_rcu(); /* unregister_kmmio_probe() requirement */ - kfree(found_trace); - } + if (found_trace) + kvfree_rcu(found_trace); /* unregister_kmmio_probe() requirement */ } void mmiotrace_iounmap(volatile void __iomem *addr) -- 2.30.2