RCU Archive mirror
 help / color / mirror / Atom feed
From: Alan Huang <mmpgouride@gmail.com>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Joel Fernandes <joel@joelfernandes.org>,
	linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
	x86@kernel.org, Lai Jiangshan <jiangshan.ljs@antgroup.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Neeraj Upadhyay <quic_neeraju@quicinc.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Zqiang <qiang.zhang1211@gmail.com>
Subject: Re: [PATCH 02/10] rcu: Move rcu_preempt_depth_set() to rcupdate.h
Date: Mon, 1 Apr 2024 19:57:40 +0800	[thread overview]
Message-ID: <60BB1971-38D3-4FE2-BB45-2DE228C6F370@gmail.com> (raw)
In-Reply-To: <073E72BD-63AF-4D88-95F8-9A002252C554@gmail.com>

2024年4月1日 19:40,Alan Huang <mmpgouride@gmail.com> wrote:
> 
> 2024年4月1日 00:16,Lai Jiangshan <jiangshanlai@gmail.com> wrote:
>> 
>> On Sun, Mar 31, 2024 at 7:10 PM Joel Fernandes <joel@joelfernandes.org> wrote:
>>> 
>>> 
>>> 
>>>> On Mar 28, 2024, at 1:20 PM, Lai Jiangshan <jiangshanlai@gmail.com> wrote:
>>>> 
>>>> From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
>>>> 
>>>> Prepare for arch-specific-defined rcu_preempt_depth_set().
>>>> 
>>>> No functionality change intended, but it has to be defined as a macro
>>>> as rcupdate.h is a very low level header included from areas that don't
>>>> even know about the task struct "current".
>>> 
>>> Sorry I did not follow changelog. If some rcupdate.h includers do not know
>>> about task_struct, how does adding a macro that uses current help?
>>> 
>> 
>> Hello
>> 
>> This is how macro works and it expands blindly based on tokens on the
>> usage-sites.
> 
> But ‘current’ still needs to be expanded at last, it seems to me that it only affects 
> the including order of the header files?
> 
> Or what am I missing?

Get the missing part: if the user don’t need to use rcu_preempt_depth() 
and rcu_preempt_depth_set() but other parts of rcupdate.h, then the two
has to be defined as a macro to avoid including linux/sched.h.

Sorry for the bother.

> 
>> 
>> And rcu_preempt_depth() & rcu_preempt_depth_set() are not universally
>> used wrappers, the user can simply also include linux/sched.h to make
>> they work.
>> 
>> Thanks
>> Lai



  reply	other threads:[~2024-04-01 11:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28  7:53 [PATCH 00/10] rcu/x86: Use per-cpu rcu preempt count Lai Jiangshan
2024-03-28  7:53 ` [PATCH 01/10] lib: Use rcu_preempt_depth() to replace current->rcu_read_lock_nesting Lai Jiangshan
2024-03-28  7:53 ` [PATCH 02/10] rcu: Move rcu_preempt_depth_set() to rcupdate.h Lai Jiangshan
2024-03-31 11:09   ` Joel Fernandes
2024-03-31 16:16     ` Lai Jiangshan
2024-04-01  2:27       ` Joel Fernandes
2024-04-01 11:40       ` Alan Huang
2024-04-01 11:57         ` Alan Huang [this message]
2024-03-28  7:53 ` [PATCH 03/10] rcu: Reorder tree_exp.h after tree_plugin.h Lai Jiangshan
2024-03-28  7:53 ` [PATCH 04/10] rcu: Add macros set_rcu_preempt_special() and clear_rcu_preempt_special() Lai Jiangshan
2024-03-28  7:53 ` [PATCH 05/10] rcu: Make rcu_read_unlock_special() global Lai Jiangshan
2024-03-28  7:53 ` [PATCH 06/10] rcu: Rename marco __LINUX_RCU_H to __KERNEL_RCU_H Lai Jiangshan
2024-03-28  7:53 ` [PATCH 07/10] sched/core: Add rcu_preempt_switch() Lai Jiangshan
2024-03-28  7:53 ` [PATCH 08/10] rcu: Implement PCPU_RCU_PREEMPT_COUNT framework Lai Jiangshan
2024-04-22 10:41   ` Frederic Weisbecker
2024-03-28  7:53 ` [PATCH 09/10] x86/rcu: Add rcu_preempt_count Lai Jiangshan
2024-03-29  7:37   ` kernel test robot
2024-03-29  7:48   ` kernel test robot
2024-04-22 11:05   ` Frederic Weisbecker
2024-04-23  9:02     ` Lai Jiangshan
2024-04-23 11:33       ` Frederic Weisbecker
2024-03-28  7:53 ` [PATCH 10/10] x86/rcu: Add THUNK rcu_read_unlock_special_thunk Lai Jiangshan
2024-03-29 14:46   ` kernel test robot

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=60BB1971-38D3-4FE2-BB45-2DE228C6F370@gmail.com \
    --to=mmpgouride@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=jiangshan.ljs@antgroup.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qiang.zhang1211@gmail.com \
    --cc=quic_neeraju@quicinc.com \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).