mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, RCU <rcu@vger.kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Michal Hocko <mhocko@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Daniel Axtens <dja@axtens.net>,
	Frederic Weisbecker <frederic@kernel.org>,
	Neeraj Upadhyay <neeraju@codeaurora.org>,
	Joel Fernandes <joel@joelfernandes.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Theodore Y . Ts'o" <tytso@mit.edu>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
Subject: Re: [PATCH 5/9] x86/mm: Switch to kvfree_rcu() API
Date: Wed, 24 Nov 2021 09:58:03 -0500	[thread overview]
Message-ID: <20211124095803.2702bc89@gandalf.local.home> (raw)
In-Reply-To: <20211124110308.2053-6-urezki@gmail.com>

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

  reply	other threads:[~2021-11-24 14:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 11:02 [PATCH 0/9] Switch to single argument " Uladzislau Rezki (Sony)
2021-11-24 11:03 ` [PATCH 1/9] ext4: Switch to " Uladzislau Rezki (Sony)
2021-12-08 14:36   ` Uladzislau Rezki
2021-11-24 11:03 ` [PATCH 2/9] ext4: Replace ext4_kvfree_array_rcu() by " Uladzislau Rezki (Sony)
2021-12-08 14:37   ` Uladzislau Rezki
2021-11-24 11:03 ` [PATCH 3/9] fs: nfs: sysfs: Switch to " Uladzislau Rezki (Sony)
2021-11-24 11:03 ` [PATCH 4/9] drivers: " Uladzislau Rezki (Sony)
2021-11-29 12:58   ` Lee Jones
2021-11-29 15:18     ` Uladzislau Rezki
2021-11-29 17:19     ` Marciniszyn, Mike
2021-12-08 15:24   ` Jason Gunthorpe
2021-11-24 11:03 ` [PATCH 5/9] x86/mm: " Uladzislau Rezki (Sony)
2021-11-24 14:58   ` Steven Rostedt [this message]
2021-11-24 14:59     ` Steven Rostedt
2021-11-24 18:01     ` Uladzislau Rezki
2021-11-24 11:03 ` [PATCH 6/9] net/tipc: " Uladzislau Rezki (Sony)
2021-11-24 11:03 ` [PATCH 7/9] net/core: " Uladzislau Rezki (Sony)
2021-11-24 11:03 ` [PATCH 8/9] module: " Uladzislau Rezki (Sony)
2021-11-30 10:39   ` Miroslav Benes
2021-11-30 11:04     ` Sebastian Andrzej Siewior
2021-12-01  9:24       ` Uladzislau Rezki
2021-12-01 20:34         ` Uladzislau Rezki
2021-11-24 11:03 ` [PATCH 9/9] tracing: " Uladzislau Rezki (Sony)
2021-11-24 15:00   ` Steven Rostedt
2021-11-24 18:03     ` Uladzislau Rezki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211124095803.2702bc89@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=dja@axtens.net \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@suse.com \
    --cc=neeraju@codeaurora.org \
    --cc=oleksiy.avramchenko@sonymobile.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=urezki@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®