aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/pid.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 09:43:54 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2011-08-27 10:06:11 -0400
commit7b1bb388bc879ffcc6c69b567816d5c354afe42b (patch)
tree5a217fdfb0b5e5a327bdcd624506337c1ae1fe32 /kernel/pid.c
parent7d754596756240fa918b94cd0c3011c77a638987 (diff)
parent02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff)
Merge 'Linux v3.0' into Litmus
Some notes: * Litmus^RT scheduling class is the topmost scheduling class (above stop_sched_class). * scheduler_ipi() function (e.g., in smp_reschedule_interrupt()) may increase IPI latencies. * Added path into schedule() to quickly re-evaluate scheduling decision without becoming preemptive again. This used to be a standard path before the removal of BKL. Conflicts: Makefile arch/arm/kernel/calls.S arch/arm/kernel/smp.c arch/x86/include/asm/unistd_32.h arch/x86/kernel/smp.c arch/x86/kernel/syscall_table_32.S include/linux/hrtimer.h kernel/printk.c kernel/sched.c kernel/sched_fair.c
Diffstat (limited to 'kernel/pid.c')
-rw-r--r--kernel/pid.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/pid.c b/kernel/pid.c
index d55c6fb8d087..57a8346a270e 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -217,11 +217,14 @@ static int alloc_pidmap(struct pid_namespace *pid_ns)
217 return -1; 217 return -1;
218} 218}
219 219
220int next_pidmap(struct pid_namespace *pid_ns, int last) 220int next_pidmap(struct pid_namespace *pid_ns, unsigned int last)
221{ 221{
222 int offset; 222 int offset;
223 struct pidmap *map, *end; 223 struct pidmap *map, *end;
224 224
225 if (last >= PID_MAX_LIMIT)
226 return -1;
227
225 offset = (last + 1) & BITS_PER_PAGE_MASK; 228 offset = (last + 1) & BITS_PER_PAGE_MASK;
226 map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE]; 229 map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE];
227 end = &pid_ns->pidmap[PIDMAP_ENTRIES]; 230 end = &pid_ns->pidmap[PIDMAP_ENTRIES];
@@ -401,7 +404,7 @@ struct task_struct *pid_task(struct pid *pid, enum pid_type type)
401 struct task_struct *result = NULL; 404 struct task_struct *result = NULL;
402 if (pid) { 405 if (pid) {
403 struct hlist_node *first; 406 struct hlist_node *first;
404 first = rcu_dereference_check(pid->tasks[type].first, 407 first = rcu_dereference_check(hlist_first_rcu(&pid->tasks[type]),
405 rcu_read_lock_held() || 408 rcu_read_lock_held() ||
406 lockdep_tasklist_lock_is_held()); 409 lockdep_tasklist_lock_is_held());
407 if (first) 410 if (first)
@@ -416,6 +419,7 @@ EXPORT_SYMBOL(pid_task);
416 */ 419 */
417struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns) 420struct task_struct *find_task_by_pid_ns(pid_t nr, struct pid_namespace *ns)
418{ 421{
422 rcu_lockdep_assert(rcu_read_lock_held());
419 return pid_task(find_pid_ns(nr, ns), PIDTYPE_PID); 423 return pid_task(find_pid_ns(nr, ns), PIDTYPE_PID);
420} 424}
421 425
@@ -434,6 +438,7 @@ struct pid *get_task_pid(struct task_struct *task, enum pid_type type)
434 rcu_read_unlock(); 438 rcu_read_unlock();
435 return pid; 439 return pid;
436} 440}
441EXPORT_SYMBOL_GPL(get_task_pid);
437 442
438struct task_struct *get_pid_task(struct pid *pid, enum pid_type type) 443struct task_struct *get_pid_task(struct pid *pid, enum pid_type type)
439{ 444{
@@ -445,6 +450,7 @@ struct task_struct *get_pid_task(struct pid *pid, enum pid_type type)
445 rcu_read_unlock(); 450 rcu_read_unlock();
446 return result; 451 return result;
447} 452}
453EXPORT_SYMBOL_GPL(get_pid_task);
448 454
449struct pid *find_get_pid(pid_t nr) 455struct pid *find_get_pid(pid_t nr)
450{ 456{