mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
	x86@kernel.org, Lai Jiangshan <jiangshan.ljs@antgroup.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <frederic@kernel.org>
Subject: Re: [PATCH V2 00/11] rcu/x86: Use per-cpu rcu preempt count
Date: Mon, 20 May 2024 13:03:18 -0700	[thread overview]
Message-ID: <363efc75-7ebf-408d-be2d-e6c579674f44@paulmck-laptop> (raw)
In-Reply-To: <20240407090558.3395-1-jiangshanlai@gmail.com>

On Sun, Apr 07, 2024 at 05:05:47PM +0800, Lai Jiangshan wrote:
> From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> 
> 
> Changed from v1:
> 	Merge thunk_64.S and thunk_32.S into thunk.S
> 	Add missing #ifdef in arch/x86/kernel/cpu/common.c
> 
> X86 can access percpu data in a single instruction.
> 
> Use per-cpu rcu preempt count and make it able to be inlined.
> 
> patch 1-8: prepare
> patch 9-11: implement PCPU_RCU_PREEMPT_COUNT
> 
> Cc: "Paul E. McKenney" <paulmck@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Frederic Weisbecker <frederic@kernel.org>

Hello, Lai!

This is really cool stuff, thank you!!!

Two big questions remain: (1) What system-level net performance benefit
is there, taking the increased context-switch overhead into account and
(2) Are the scheduler maintainers on board with these changes?

On #1, I do well recall your ca. 2019 points about the improved code
generated, but I have seen cases where improved code actually ran
more slowly.  My guess is that you have the best chance of seeing
system-level benefits on low-end x86 platforms, perhaps the old Atom
or Celeron systems.  The rcuref module provides a good way of doing
microbenchmarks, which would be a good start.  Other metrics that
might help include overall kernel code size.

On #2, good data for #1 would help greatly.

Thoughts?

							Thanx, Paul

> Lai Jiangshan (11):
>   lib: Use rcu_preempt_depth() to replace current->rcu_read_lock_nesting
>   rcu: Move rcu_preempt_depth_set() to rcupdate.h
>   rcu: Reorder tree_exp.h after tree_plugin.h
>   rcu: Add macros set_rcu_preempt_special() and
>     clear_rcu_preempt_special()
>   rcu: Make rcu_read_unlock_special() global
>   rcu: Rename marco __LINUX_RCU_H to __KERNEL_RCU_H
>   sched/core: Add rcu_preempt_switch()
>   x86/entry: Merge thunk_64.S and thunk_32.S into thunk.S
>   rcu: Implement PCPU_RCU_PREEMPT_COUNT framework
>   x86/rcu: Add rcu_preempt_count
>   x86/rcu: Add THUNK rcu_read_unlock_special_thunk
> 
>  arch/x86/Kconfig                       |   1 +
>  arch/x86/entry/Makefile                |   2 +-
>  arch/x86/entry/{thunk_64.S => thunk.S} |   5 ++
>  arch/x86/entry/thunk_32.S              |  18 ----
>  arch/x86/include/asm/current.h         |   3 +
>  arch/x86/include/asm/rcu_preempt.h     | 109 +++++++++++++++++++++++++
>  arch/x86/kernel/cpu/common.c           |   4 +
>  include/linux/rcupdate.h               |  36 ++++++++
>  kernel/rcu/Kconfig                     |   8 ++
>  kernel/rcu/rcu.h                       |  15 +++-
>  kernel/rcu/tree.c                      |   2 +-
>  kernel/rcu/tree_exp.h                  |   2 +-
>  kernel/rcu/tree_plugin.h               |  41 ++++++----
>  kernel/sched/core.c                    |   2 +
>  lib/locking-selftest.c                 |   6 +-
>  15 files changed, 212 insertions(+), 42 deletions(-)
>  rename arch/x86/entry/{thunk_64.S => thunk.S} (72%)
>  delete mode 100644 arch/x86/entry/thunk_32.S
>  create mode 100644 arch/x86/include/asm/rcu_preempt.h
> 
> 
> base-commit: f2f80ac809875855ac843f9e5e7480604b5cbff5
> -- 
> 2.19.1.6.gb485710b
> 

      parent reply	other threads:[~2024-05-20 20:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07  9:05 Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 01/11] lib: Use rcu_preempt_depth() to replace current->rcu_read_lock_nesting Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 02/11] rcu: Move rcu_preempt_depth_set() to rcupdate.h Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 03/11] rcu: Reorder tree_exp.h after tree_plugin.h Lai Jiangshan
2024-04-23 17:58   ` Joel Fernandes
2024-04-24  2:47     ` Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 04/11] rcu: Add macros set_rcu_preempt_special() and clear_rcu_preempt_special() Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 05/11] rcu: Make rcu_read_unlock_special() global Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 06/11] rcu: Rename marco __LINUX_RCU_H to __KERNEL_RCU_H Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 07/11] sched/core: Add rcu_preempt_switch() Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 08/11] x86/entry: Merge thunk_64.S and thunk_32.S into thunk.S Lai Jiangshan
2024-04-09  8:27   ` [tip: x86/entry] " tip-bot2 for Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 09/11] rcu: Implement PCPU_RCU_PREEMPT_COUNT framework Lai Jiangshan
2024-04-23 18:19   ` Joel Fernandes
2024-04-24  3:02     ` Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 10/11] x86/rcu: Add rcu_preempt_count Lai Jiangshan
2024-04-23 18:09   ` Joel Fernandes
2024-04-24  2:53     ` Lai Jiangshan
2024-04-07  9:05 ` [PATCH V2 11/11] x86/rcu: Add THUNK rcu_read_unlock_special_thunk Lai Jiangshan
2024-04-23 17:26   ` Joel Fernandes
2024-04-24  2:43     ` Lai Jiangshan
2024-05-20 20:03 ` Paul E. McKenney [this message]

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=363efc75-7ebf-408d-be2d-e6c579674f44@paulmck-laptop \
    --to=paulmck@kernel.org \
    --cc=frederic@kernel.org \
    --cc=jiangshan.ljs@antgroup.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=x86@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 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®