lkml.org 
[lkml]   [2021]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/9] x86/mm: Switch to kvfree_rcu() API
On Wed, 24 Nov 2021 12:03:04 +0100
"Uladzislau Rezki (Sony)" <urezki@gmail.com> wrote:

> 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 */
> }
>

This is the first I've seen kvfree_rcu() (that I actually noticed/remember,
I'm sure I probably was Cc'd on some patches). And I find the comment
around it very confusing:

Specifically:


* kvfree_rcu(ptr);
*
* where @ptr is a pointer to kvfree().

The above suggests that you should pass a pointer to the actual function
kvfree to kvfree_rcu(), which is not what I believe is to be done.

i.e. kvfree_rcu(kvfree) ???

Perhaps rewrite that to say:

* where @ptr is the pointer to be freed by kvfree().

?

Other than that, the patch looks fine to me.

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

\
 
 \ /
  Last update: 2021-11-24 15:59    [W:0.182 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site