lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110405215450.GK2247@linux.vnet.ibm.com>
Date:	Tue, 5 Apr 2011 14:54:50 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Lai Jiangshan <laijs@...fujitsu.com>,
	Michal Marek <mmarek@...e.cz>,
	"H. Peter Anvin" <hpa@...ux.intel.com>,
	Jan Beulich <JBeulich@...ell.com>, Ingo Molnar <mingo@...e.hu>,
	Alexander van Heukelum <heukelum@...tmail.fm>,
	Dipankar Sarma <dipankar@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Sam Ravnborg <sam@...nborg.org>,
	David Howells <dhowells@...hat.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Roland McGrath <roland@...hat.com>,
	Serge Hallyn <serue@...ibm.com>, linux-kernel@...r.kernel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Re: [RFC PATCH 4/5] RCU: Add TASK_RCU_OFFSET

On Fri, Apr 01, 2011 at 01:35:49PM +0200, Peter Zijlstra wrote:
> On Fri, 2011-04-01 at 09:57 +0800, Lai Jiangshan wrote:
> > 
> > We are trying to use inlined read_read_[un]lock(), it is required that sched.h
> > needs include rcupdate.h which causes many recursive including. Splitting rcupdate.h
> > only does not help. 
> 
> You're not making any kind of sense there.
> 
> linux-2.6# cat kernel/sched_tmp.c 
> 
> #include <linux/sched.h>
> 
> linux-2.6# make kernel/sched_tmp.i
> linux-2.6# awk '/^#/ { t=$0 } /rcu_read_lock/ { print t " " $0 }' kernel/sched_tmp.i
> # 60 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline void __rcu_read_lock_bh(void)
> # 60 "/usr/src/linux-2.6/include/linux/rcupdate.h" extern void __rcu_read_lock(void);
> # 258 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline int rcu_read_lock_held(void)
> # 258 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline int rcu_read_lock_bh_held(void)
> # 258 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline int rcu_read_lock_sched_held(void)
> # 559 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline void rcu_read_lock(void)
> # 559 "/usr/src/linux-2.6/include/linux/rcupdate.h"  __rcu_read_lock();
> # 600 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline void rcu_read_lock_bh(void)
> # 600 "/usr/src/linux-2.6/include/linux/rcupdate.h"  __rcu_read_lock_bh();
> # 627 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline void rcu_read_lock_sched(void)
> # 627 "/usr/src/linux-2.6/include/linux/rcupdate.h" static inline __attribute__((no_instrument_function)) void rcu_read_lock_sched_notrace(void)
> # 70 "/usr/src/linux-2.6/include/linux/srcu.h" int __srcu_read_lock(struct srcu_struct *sp) ;
> # 103 "/usr/src/linux-2.6/include/linux/srcu.h" static inline int srcu_read_lock_held(struct srcu_struct *sp)
> # 149 "/usr/src/linux-2.6/include/linux/srcu.h" static inline int srcu_read_lock(struct srcu_struct *sp)
> # 149 "/usr/src/linux-2.6/include/linux/srcu.h"  int retval = __srcu_read_lock(sp);
> # 1227 "/usr/src/linux-2.6/include/linux/sched.h"  int rcu_read_lock_nesting;
> # 1786 "/usr/src/linux-2.6/include/linux/sched.h"  p->rcu_read_lock_nesting = 0;
> 
> There isn't a single rcu_read_lock() user in the include chain of
> sched.h, therefore its possible to split rcupdate.h such that one part
> includes the bits needed for sched.h and another part that includes
> sched.h and provides rcu_read_lock().

Yep, you can easily split struct rcu_head out into its own header file,
and then include that into sched.h in place of rcupdate.h without trouble
(at least in the few builds I tried).

The trouble comes when you take the next step and include sched.h
into include/linux/rcutree.h, which would be needed to allow
TREE_PREEMPT_RCU's rcu_read_lock() and rcu_read_unlock() to be
inlined.  This pulls sched.h into files that it was not already
included into, and we do get build failures (the first of which
requires changes local to RCU, FWIW).

Of course, it would be good to straighten this out.

							Thanx, Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ