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
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ray Lee
Re: New thread RDSL, post-2.6.20 kernels and amanda (tar) miss-fires
Alan Cox
Re: [linux-pm] [PATCH 0/8] Suspend block api (version 8)
Tejun Heo
Re: your mail
Werner Cornelius
Serial USB-driver for Winchiphead CH340/41 chip
Ingo Molnar
Re: [patch] e1000=y && e1000e=m regression fix
git
:
Bill Lear
cpio command not found
Gary Yang
fatal: did you run git update-server-info on the server? mv post-update.sample pos...
Ben Schmidt
Getting the path right for git over SSH
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
Laflen, Brandon (GE, Research)
RE: fatal: Unable to find remote helper for 'http'
linux-netdev
:
Stephen Hemminger
Re: vlan JMicron Technologies, Inc. JMC250 PCI Express Gigabit Ethernet
Sage Weil
Re: [2/3] POHMELFS: Documentation.
Patrick McHardy
Re: [ANNOUNCE]: First release of nftables
Frans Pop
svc: failed to register lockdv1 RPC service (errno 97).
Sage Weil
Re: [2/3] POHMELFS: Documentation.
openbsd-misc
:
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Ted Unangst
Re: OpenSMTPd actual development and integration
Paul M
Corrupted RAIDFrame device
nixlists
Re: OpenSMTPd actual development and integration
noreply
Rowiw újraindult!
git-commits-head
:
Linux Kernel Mailing List
Remove empty comment in acpi/power.c
Linux Kernel Mailing List
Linux 2.6.34-rc4
Linux Kernel Mailing List
ALSA: cosmetic: make hda intel interrupt name consistent with others
Linux Kernel Mailing List
swiotlb: replace architecture-specific swiotlb.h with linux/swiotlb.h
Linux Kernel Mailing List
x86 boot: only pick up additional EFI memmap if add_efi_memmap flag
Colocation donated by:
Syndicate