login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
24
Re: [PATCH] Documentation/cred.txt: spinlock no longer implies rcu_read_lock
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Paul E. McKenney
Subject:
Re: [PATCH] Documentation/cred.txt: spinlock no longer implies rcu_read_lock
Date: Friday, April 23, 2010 - 6:24 pm
On Fri, Apr 23, 2010 at 07:45:57PM -0500, Serge E. Hallyn wrote:
quoted text
> So change the credentials documentation to make it clear that rcu > read lock is required.
Very good! Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
quoted text
> Signed-off-by: Serge Hallyn <serue@us.ibm.com> > --- > Documentation/credentials.txt | 8 ++------ > 1 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/Documentation/credentials.txt b/Documentation/credentials.txt > index df03169..98a1e9e 100644 > --- a/Documentation/credentials.txt > +++ b/Documentation/credentials.txt > @@ -408,9 +408,6 @@ This should be used inside the RCU read lock, as in the following example: > ... > } > > -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. > - > Should it be necessary to hold another task's credentials for a long period of > time, and possibly to sleep whilst doing so, then the caller should get a > reference on them using: > @@ -426,14 +423,13 @@ credentials, hiding the RCU magic from the caller: > uid_t task_uid(task) Task's real UID > uid_t task_euid(task) Task's effective UID > > -If the caller is holding a spinlock or the RCU read lock at the time anyway, > -then: > +If the caller is holding the RCU read lock at the time anyway, then: > > __task_cred(task)->uid > __task_cred(task)->euid > > should be used instead. Similarly, if multiple aspects of a task's credentials > -need to be accessed, RCU read lock or a spinlock should be used, __task_cred() > +need to be accessed, RCU read lock should be used, __task_cred() > called, the result stored in a temporary pointer and then the credential > aspects called from that before dropping the lock. This prevents the > potentially expensive RCU magic from being invoked multiple times. > -- > 1.6.3.3 >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] Documentation/cred.txt: spinlock no longer implies ...
, Serge E. Hallyn
, (Fri Apr 23, 5:45 pm)
Re: [PATCH] Documentation/cred.txt: spinlock no longer imp ...
, Paul E. McKenney
, (Fri Apr 23, 6:24 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.
Linux Kernel Mailing List
ixgbe: fix several counter register errata
Linux Kernel Mailing List
b43: fix build with CONFIG_SSB_PCIHOST=n
Linux Kernel Mailing List
9p: block-based virtio client
linux-netdev
:
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
David Daney
[PATCH 5/7] Staging: Octeon Ethernet: Convert to NAPI.
Wolfgang Grandegger
[PATCH net-next v4 1/3] can: mscan: fix improper return if dlc < 8 in start_xmi...
Amit Kumar Salecha
[PATCHv3 NEXT 2/2] NET: Add Qlogic ethernet driver for CNA devices
openbsd-misc
:
Theo de Raadt
Re: Old IPSEC bug
Tomáš Bodžár
Problem with vpnc connection - check group password !
Insan Praja SW
Mandoc Compiling Error
Carl Roberso