From: Uladzislau Rezki <urezki@gmail.com>
To: Zqiang <qiang1.zhang@intel.com>
Cc: urezki@gmail.com, paulmck@kernel.org, frederic@kernel.org,
joel@joelfernandes.org, qiang.zhang1211@gmail.com,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] rcu/kvfree: Make drain_page_cache() call return directly if cache is disabled
Date: Thu, 20 Apr 2023 13:06:27 +0200 [thread overview]
Message-ID: <ZEEcsyn27ssrdfh6@pc636> (raw)
In-Reply-To: <20230418122702.1378299-1-qiang1.zhang@intel.com>
On Tue, Apr 18, 2023 at 08:27:02PM +0800, Zqiang wrote:
> If the rcu_min_cached_objs is set to zero at boot params, the
> krcp->page_cache_work will not be triggered to fill page cache,
> and the put_cached_bnode() also does not fill page cache, this
> also means the krcp->bkvcache is always empty, so not need to
> acquire unnecessary krcp->lock to get page from krcp->bkvcache,
> this commit therefore make drain_page_cache() return directly if
> the rcu_min_cached_objs is zero.
>
> Signed-off-by: Zqiang <qiang1.zhang@intel.com>
> ---
> kernel/rcu/tree.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 93faf9f5c58f..00620a2117de 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2924,6 +2924,9 @@ drain_page_cache(struct kfree_rcu_cpu *krcp)
> struct llist_node *page_list, *pos, *n;
> int freed = 0;
>
> + if (!rcu_min_cached_objs)
> + return 0;
> +
> raw_spin_lock_irqsave(&krcp->lock, flags);
> page_list = llist_del_all(&krcp->bkvcache);
> WRITE_ONCE(krcp->nr_bkv_objs, 0);
> --
> 2.32.0
>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
--
Uladzislau Rezki
next prev parent reply other threads:[~2023-04-20 11:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 12:27 [PATCH v2] rcu/kvfree: Make drain_page_cache() call return directly if cache is disabled Zqiang
2023-04-20 11:06 ` Uladzislau Rezki [this message]
2023-04-24 17:35 ` Paul E. McKenney
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=ZEEcsyn27ssrdfh6@pc636 \
--to=urezki@gmail.com \
--cc=frederic@kernel.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=qiang1.zhang@intel.com \
--cc=rcu@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.