From: Joel Fernandes <joel@joelfernandes.org>
To: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Paul E . McKenney" <paulmck@kernel.org>,
RCU <rcu@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Steven Rostedt <rostedt@goodmis.org>,
Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>
Subject: Re: [PATCH v1 4/6] rcu: rename __is_kfree_rcu_offset() macro
Date: Mon, 16 Mar 2020 11:48:50 -0400 [thread overview]
Message-ID: <20200316154850.GG190951@google.com> (raw)
In-Reply-To: <20200315181840.6966-5-urezki@gmail.com>
On Sun, Mar 15, 2020 at 07:18:38PM +0100, Uladzislau Rezki (Sony) wrote:
> Rename __is_kfree_rcu_offset to __is_kvfree_rcu_offset.
> All RCU paths use kvfree() now instead of kfree(), thus
> rename it.
This patch LGTM:
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
thanks,
- Joel
>
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
> ---
> include/linux/rcupdate.h | 6 +++---
> kernel/rcu/tiny.c | 2 +-
> kernel/rcu/tree.c | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index bb270221dbdc..e4961631a44f 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -798,16 +798,16 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
>
> /*
> * Does the specified offset indicate that the corresponding rcu_head
> - * structure can be handled by kfree_rcu()?
> + * structure can be handled by kvfree_rcu()?
> */
> -#define __is_kfree_rcu_offset(offset) ((offset) < 4096)
> +#define __is_kvfree_rcu_offset(offset) ((offset) < 4096)
>
> /*
> * Helper macro for kfree_rcu() to prevent argument-expansion eyestrain.
> */
> #define __kfree_rcu(head, offset) \
> do { \
> - BUILD_BUG_ON(!__is_kfree_rcu_offset(offset)); \
> + BUILD_BUG_ON(!__is_kvfree_rcu_offset(offset)); \
> kfree_call_rcu(head, (rcu_callback_t)(unsigned long)(offset)); \
> } while (0)
>
> diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
> index 3dd8e6e207b0..aa897c3f2e92 100644
> --- a/kernel/rcu/tiny.c
> +++ b/kernel/rcu/tiny.c
> @@ -85,7 +85,7 @@ static inline bool rcu_reclaim_tiny(struct rcu_head *head)
> unsigned long offset = (unsigned long)head->func;
>
> rcu_lock_acquire(&rcu_callback_map);
> - if (__is_kfree_rcu_offset(offset)) {
> + if (__is_kvfree_rcu_offset(offset)) {
> trace_rcu_invoke_kvfree_callback("", head, offset);
> kvfree((void *)head - offset);
> rcu_lock_release(&rcu_callback_map);
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index eef75cd210fd..bb9544238396 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2719,7 +2719,7 @@ __call_rcu(struct rcu_head *head, rcu_callback_t func)
> return; // Enqueued onto ->nocb_bypass, so just leave.
> // If no-CBs CPU gets here, rcu_nocb_try_bypass() acquired ->nocb_lock.
> rcu_segcblist_enqueue(&rdp->cblist, head);
> - if (__is_kfree_rcu_offset((unsigned long)func))
> + if (__is_kvfree_rcu_offset((unsigned long)func))
> trace_rcu_kvfree_callback(rcu_state.name, head,
> (unsigned long)func,
> rcu_segcblist_n_cbs(&rdp->cblist));
> @@ -2911,7 +2911,7 @@ static void kfree_rcu_work(struct work_struct *work)
> rcu_lock_acquire(&rcu_callback_map);
> trace_rcu_invoke_kvfree_callback(rcu_state.name, head, offset);
>
> - if (!WARN_ON_ONCE(!__is_kfree_rcu_offset(offset)))
> + if (!WARN_ON_ONCE(!__is_kvfree_rcu_offset(offset)))
> kvfree((void *)head - offset);
>
> rcu_lock_release(&rcu_callback_map);
> --
> 2.20.1
>
next prev parent reply other threads:[~2020-03-16 15:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-15 18:18 [PATCH v1 0/6] Introduce kvfree_rcu() logic Uladzislau Rezki (Sony)
2020-03-15 18:18 ` [PATCH v1 1/6] mm/list_lru.c: rename kvfree_rcu() to local variant Uladzislau Rezki (Sony)
2020-03-15 18:18 ` [PATCH v1 2/6] rcu: introduce kvfree_rcu() interface Uladzislau Rezki (Sony)
2020-03-16 15:45 ` Joel Fernandes
2020-03-16 18:55 ` Uladzislau Rezki
2020-03-16 18:57 ` Joel Fernandes
2020-03-16 19:01 ` Joel Fernandes
2020-03-16 19:03 ` Uladzislau Rezki
2020-03-16 19:48 ` Joel Fernandes
2020-03-15 18:18 ` [PATCH v1 3/6] rcu: rename rcu_invoke_kfree_callback/rcu_kfree_callback Uladzislau Rezki (Sony)
2020-03-16 15:47 ` Joel Fernandes
2020-03-15 18:18 ` [PATCH v1 4/6] rcu: rename __is_kfree_rcu_offset() macro Uladzislau Rezki (Sony)
2020-03-16 15:48 ` Joel Fernandes [this message]
2020-03-15 18:18 ` [PATCH v1 5/6] rcu: rename kfree_call_rcu()/__kfree_rcu() Uladzislau Rezki (Sony)
2020-03-16 15:25 ` Joel Fernandes
2020-03-16 19:01 ` Uladzislau Rezki
2020-04-21 3:15 ` Andrew Morton
2020-04-21 12:03 ` Uladzislau Rezki
2020-04-22 23:03 ` Joel Fernandes
2020-04-22 23:16 ` Paul E. McKenney
2020-03-15 18:18 ` [PATCH v1 6/6] mm/list_lru.c: remove kvfree_rcu_local() function Uladzislau Rezki (Sony)
2020-03-16 15:49 ` Joel Fernandes
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=20200316154850.GG190951@google.com \
--to=joel@joelfernandes.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksiy.avramchenko@sonymobile.com \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--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;
as well as URLs for NNTP newsgroup(s).