KVM: MMU: invalidate and flush on spte small->large page size change
[safe/jmp/linux-2.6] / kernel / pid.c
index 86b2969..e9fd8c1 100644 (file)
@@ -367,7 +367,9 @@ struct task_struct *pid_task(struct pid *pid, enum pid_type type)
        struct task_struct *result = NULL;
        if (pid) {
                struct hlist_node *first;
-               first = rcu_dereference_check(pid->tasks[type].first, rcu_read_lock_held() || lockdep_is_held(&tasklist_lock));
+               first = rcu_dereference_check(pid->tasks[type].first,
+                                             rcu_read_lock_held() ||
+                                             lockdep_tasklist_lock_is_held());
                if (first)
                        result = hlist_entry(first, struct task_struct, pids[(type)].node);
        }
@@ -511,6 +513,13 @@ void __init pidhash_init(void)
 
 void __init pidmap_init(void)
 {
+       /* bump default and minimum pid_max based on number of cpus */
+       pid_max = min(pid_max_max, max_t(int, pid_max,
+                               PIDS_PER_CPU_DEFAULT * num_possible_cpus()));
+       pid_max_min = max_t(int, pid_max_min,
+                               PIDS_PER_CPU_MIN * num_possible_cpus());
+       pr_info("pid_max: default: %u minimum: %u\n", pid_max, pid_max_min);
+
        init_pid_ns.pidmap[0].page = kzalloc(PAGE_SIZE, GFP_KERNEL);
        /* Reserve PID 0. We never call free_pidmap(0) */
        set_bit(0, init_pid_ns.pidmap[0].page);