public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Documentation/credentials.txt
@ 2010-04-23 23:55 Serge E. Hallyn
  2010-04-24  0:14 ` Documentation/credentials.txt Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Serge E. Hallyn @ 2010-04-23 23:55 UTC (permalink / raw)
  To: David Howells, Paul E. McKenney; +Cc: lkml

Hi,

In the section 'ACCESSING ANOTHER TASK'S CREDENTIALS', the file
Documentation/credentials.txt says:

> A function need not get RCU read lock to use __task_cred() if it is holding a
> spinlock at the time as this implicitly holds the RCU read lock.

AIUI, that is not actually right any more, is it?  A spinlock does not
suffice as it does not necessarily imply an RCU read-side critical section
(anymore).  Of course the spinlock specifically protecting updates would
suffice, but that's not what this is saying.

Am I way off base?

thanks,
-serge

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Documentation/credentials.txt
  2010-04-23 23:55 Documentation/credentials.txt Serge E. Hallyn
@ 2010-04-24  0:14 ` Paul E. McKenney
  2010-04-24  0:46   ` Documentation/credentials.txt Serge E. Hallyn
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2010-04-24  0:14 UTC (permalink / raw)
  To: Serge E. Hallyn; +Cc: David Howells, lkml

On Fri, Apr 23, 2010 at 06:55:33PM -0500, Serge E. Hallyn wrote:
> Hi,
> 
> In the section 'ACCESSING ANOTHER TASK'S CREDENTIALS', the file
> Documentation/credentials.txt says:
> 
> > A function need not get RCU read lock to use __task_cred() if it is holding a
> > spinlock at the time as this implicitly holds the RCU read lock.
> 
> AIUI, that is not actually right any more, is it?  A spinlock does not
> suffice as it does not necessarily imply an RCU read-side critical section
> (anymore).  Of course the spinlock specifically protecting updates would
> suffice, but that's not what this is saying.
> 
> Am I way off base?

You are absolutely correct, good catch!!!

Now, a spinlock still does imply an RCU read-side critical section given
the following configuration options:

o	!CONFIG_PREEMPT

o	CONFIG_PREEMPT && CONFIG_TREE_RCU

o	CONFIG_PREEMPT && CONFIG_TINY_RCU

However, relying on this is usually bad practice, as such code is prone
to failure given the following configuration options:

o	CONFIG_PREEMPT && CONFIG_TREE_PREEMPT_RCU

o	CONFIG_PREEMPT_RT (given the -rt patchset)

And when I get my act together and complete CONFIG_TINY_PREEMPT_RCU,
then CONFIG_PREEMPT && CONFIG_TINY_PREEMPT_RCU will also invalidate
the assumption that holding a spinlock acts as an RCU read-side
critical section.

Did you want to submit a patch for this?

							Thanx, Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Documentation/credentials.txt
  2010-04-24  0:14 ` Documentation/credentials.txt Paul E. McKenney
@ 2010-04-24  0:46   ` Serge E. Hallyn
  0 siblings, 0 replies; 3+ messages in thread
From: Serge E. Hallyn @ 2010-04-24  0:46 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: David Howells, lkml

Quoting Paul E. McKenney (paulmck@linux.vnet.ibm.com):
> On Fri, Apr 23, 2010 at 06:55:33PM -0500, Serge E. Hallyn wrote:
> > Hi,
> > 
> > In the section 'ACCESSING ANOTHER TASK'S CREDENTIALS', the file
> > Documentation/credentials.txt says:
> > 
> > > A function need not get RCU read lock to use __task_cred() if it is holding a
> > > spinlock at the time as this implicitly holds the RCU read lock.
> > 
> > AIUI, that is not actually right any more, is it?  A spinlock does not
> > suffice as it does not necessarily imply an RCU read-side critical section
> > (anymore).  Of course the spinlock specifically protecting updates would
> > suffice, but that's not what this is saying.
> > 
> > Am I way off base?
> 
> You are absolutely correct, good catch!!!
> 
> Now, a spinlock still does imply an RCU read-side critical section given
> the following configuration options:
> 
> o	!CONFIG_PREEMPT
> 
> o	CONFIG_PREEMPT && CONFIG_TREE_RCU
> 
> o	CONFIG_PREEMPT && CONFIG_TINY_RCU
> 
> However, relying on this is usually bad practice, as such code is prone
> to failure given the following configuration options:
> 
> o	CONFIG_PREEMPT && CONFIG_TREE_PREEMPT_RCU
> 
> o	CONFIG_PREEMPT_RT (given the -rt patchset)
> 
> And when I get my act together and complete CONFIG_TINY_PREEMPT_RCU,
> then CONFIG_PREEMPT && CONFIG_TINY_PREEMPT_RCU will also invalidate
> the assumption that holding a spinlock acts as an RCU read-side
> critical section.
> 
> Did you want to submit a patch for this?

Yup, sent, thanks.

-serge

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-24  0:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-23 23:55 Documentation/credentials.txt Serge E. Hallyn
2010-04-24  0:14 ` Documentation/credentials.txt Paul E. McKenney
2010-04-24  0:46   ` Documentation/credentials.txt Serge E. Hallyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox