diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-01-30 12:23:30 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-01-30 12:23:30 -0500 |
| commit | c43e0e46adf79c321ed3fbf0351e1005fb8a2413 (patch) | |
| tree | 35b9ab361651f649d3c9aa69f159812eba50d154 /kernel | |
| parent | dba3d36b2f0842ed7f25c33cd3a2ccdb3d0df9db (diff) | |
| parent | f2257b70b0f9b2fe8f2afd83fc6798dca75930b8 (diff) | |
Merge branch 'linus' into core/percpu
Conflicts:
kernel/irq/handle.c
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/cgroup.c | 28 | ||||
| -rw-r--r-- | kernel/irq/handle.c | 16 | ||||
| -rw-r--r-- | kernel/irq/manage.c | 10 | ||||
| -rw-r--r-- | kernel/power/disk.c | 10 |
4 files changed, 45 insertions, 19 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index c29831076e7a..5a54ff42874e 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -1115,8 +1115,10 @@ static void cgroup_kill_sb(struct super_block *sb) { | |||
| 1115 | } | 1115 | } |
| 1116 | write_unlock(&css_set_lock); | 1116 | write_unlock(&css_set_lock); |
| 1117 | 1117 | ||
| 1118 | list_del(&root->root_list); | 1118 | if (!list_empty(&root->root_list)) { |
| 1119 | root_count--; | 1119 | list_del(&root->root_list); |
| 1120 | root_count--; | ||
| 1121 | } | ||
| 1120 | 1122 | ||
| 1121 | mutex_unlock(&cgroup_mutex); | 1123 | mutex_unlock(&cgroup_mutex); |
| 1122 | 1124 | ||
| @@ -2434,7 +2436,9 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, | |||
| 2434 | 2436 | ||
| 2435 | err_remove: | 2437 | err_remove: |
| 2436 | 2438 | ||
| 2439 | cgroup_lock_hierarchy(root); | ||
| 2437 | list_del(&cgrp->sibling); | 2440 | list_del(&cgrp->sibling); |
| 2441 | cgroup_unlock_hierarchy(root); | ||
| 2438 | root->number_of_cgroups--; | 2442 | root->number_of_cgroups--; |
| 2439 | 2443 | ||
| 2440 | err_destroy: | 2444 | err_destroy: |
| @@ -2507,7 +2511,7 @@ static int cgroup_clear_css_refs(struct cgroup *cgrp) | |||
| 2507 | for_each_subsys(cgrp->root, ss) { | 2511 | for_each_subsys(cgrp->root, ss) { |
| 2508 | struct cgroup_subsys_state *css = cgrp->subsys[ss->subsys_id]; | 2512 | struct cgroup_subsys_state *css = cgrp->subsys[ss->subsys_id]; |
| 2509 | int refcnt; | 2513 | int refcnt; |
| 2510 | do { | 2514 | while (1) { |
| 2511 | /* We can only remove a CSS with a refcnt==1 */ | 2515 | /* We can only remove a CSS with a refcnt==1 */ |
| 2512 | refcnt = atomic_read(&css->refcnt); | 2516 | refcnt = atomic_read(&css->refcnt); |
| 2513 | if (refcnt > 1) { | 2517 | if (refcnt > 1) { |
| @@ -2521,7 +2525,10 @@ static int cgroup_clear_css_refs(struct cgroup *cgrp) | |||
| 2521 | * css_tryget() to spin until we set the | 2525 | * css_tryget() to spin until we set the |
| 2522 | * CSS_REMOVED bits or abort | 2526 | * CSS_REMOVED bits or abort |
| 2523 | */ | 2527 | */ |
| 2524 | } while (atomic_cmpxchg(&css->refcnt, refcnt, 0) != refcnt); | 2528 | if (atomic_cmpxchg(&css->refcnt, refcnt, 0) == refcnt) |
| 2529 | break; | ||
| 2530 | cpu_relax(); | ||
| 2531 | } | ||
| 2525 | } | 2532 | } |
| 2526 | done: | 2533 | done: |
| 2527 | for_each_subsys(cgrp->root, ss) { | 2534 | for_each_subsys(cgrp->root, ss) { |
| @@ -2991,20 +2998,21 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys, | |||
| 2991 | mutex_unlock(&cgroup_mutex); | 2998 | mutex_unlock(&cgroup_mutex); |
| 2992 | return 0; | 2999 | return 0; |
| 2993 | } | 3000 | } |
| 2994 | task_lock(tsk); | ||
| 2995 | cg = tsk->cgroups; | ||
| 2996 | parent = task_cgroup(tsk, subsys->subsys_id); | ||
| 2997 | 3001 | ||
| 2998 | /* Pin the hierarchy */ | 3002 | /* Pin the hierarchy */ |
| 2999 | if (!atomic_inc_not_zero(&parent->root->sb->s_active)) { | 3003 | if (!atomic_inc_not_zero(&root->sb->s_active)) { |
| 3000 | /* We race with the final deactivate_super() */ | 3004 | /* We race with the final deactivate_super() */ |
| 3001 | mutex_unlock(&cgroup_mutex); | 3005 | mutex_unlock(&cgroup_mutex); |
| 3002 | return 0; | 3006 | return 0; |
| 3003 | } | 3007 | } |
| 3004 | 3008 | ||
| 3005 | /* Keep the cgroup alive */ | 3009 | /* Keep the cgroup alive */ |
| 3010 | task_lock(tsk); | ||
| 3011 | parent = task_cgroup(tsk, subsys->subsys_id); | ||
| 3012 | cg = tsk->cgroups; | ||
| 3006 | get_css_set(cg); | 3013 | get_css_set(cg); |
| 3007 | task_unlock(tsk); | 3014 | task_unlock(tsk); |
| 3015 | |||
| 3008 | mutex_unlock(&cgroup_mutex); | 3016 | mutex_unlock(&cgroup_mutex); |
| 3009 | 3017 | ||
| 3010 | /* Now do the VFS work to create a cgroup */ | 3018 | /* Now do the VFS work to create a cgroup */ |
| @@ -3043,7 +3051,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys, | |||
| 3043 | mutex_unlock(&inode->i_mutex); | 3051 | mutex_unlock(&inode->i_mutex); |
| 3044 | put_css_set(cg); | 3052 | put_css_set(cg); |
| 3045 | 3053 | ||
| 3046 | deactivate_super(parent->root->sb); | 3054 | deactivate_super(root->sb); |
| 3047 | /* The cgroup is still accessible in the VFS, but | 3055 | /* The cgroup is still accessible in the VFS, but |
| 3048 | * we're not going to try to rmdir() it at this | 3056 | * we're not going to try to rmdir() it at this |
| 3049 | * point. */ | 3057 | * point. */ |
| @@ -3069,7 +3077,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys, | |||
| 3069 | mutex_lock(&cgroup_mutex); | 3077 | mutex_lock(&cgroup_mutex); |
| 3070 | put_css_set(cg); | 3078 | put_css_set(cg); |
| 3071 | mutex_unlock(&cgroup_mutex); | 3079 | mutex_unlock(&cgroup_mutex); |
| 3072 | deactivate_super(parent->root->sb); | 3080 | deactivate_super(root->sb); |
| 3073 | return ret; | 3081 | return ret; |
| 3074 | } | 3082 | } |
| 3075 | 3083 | ||
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 375d68cd5bf0..f51eaee921b6 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
| @@ -40,6 +40,18 @@ void handle_bad_irq(unsigned int irq, struct irq_desc *desc) | |||
| 40 | ack_bad_irq(irq); | 40 | ack_bad_irq(irq); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) | ||
| 44 | static void __init init_irq_default_affinity(void) | ||
| 45 | { | ||
| 46 | alloc_bootmem_cpumask_var(&irq_default_affinity); | ||
| 47 | cpumask_setall(irq_default_affinity); | ||
| 48 | } | ||
| 49 | #else | ||
| 50 | static void __init init_irq_default_affinity(void) | ||
| 51 | { | ||
| 52 | } | ||
| 53 | #endif | ||
| 54 | |||
| 43 | /* | 55 | /* |
| 44 | * Linux has a controller-independent interrupt architecture. | 56 | * Linux has a controller-independent interrupt architecture. |
| 45 | * Every controller has a 'controller-template', that is used | 57 | * Every controller has a 'controller-template', that is used |
| @@ -133,6 +145,8 @@ int __init early_irq_init(void) | |||
| 133 | int legacy_count; | 145 | int legacy_count; |
| 134 | int i; | 146 | int i; |
| 135 | 147 | ||
| 148 | init_irq_default_affinity(); | ||
| 149 | |||
| 136 | /* initialize nr_irqs based on nr_cpu_ids */ | 150 | /* initialize nr_irqs based on nr_cpu_ids */ |
| 137 | arch_probe_nr_irqs(); | 151 | arch_probe_nr_irqs(); |
| 138 | printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d\n", NR_IRQS, nr_irqs); | 152 | printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d\n", NR_IRQS, nr_irqs); |
| @@ -229,6 +243,8 @@ int __init early_irq_init(void) | |||
| 229 | int count; | 243 | int count; |
| 230 | int i; | 244 | int i; |
| 231 | 245 | ||
| 246 | init_irq_default_affinity(); | ||
| 247 | |||
| 232 | printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS); | 248 | printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS); |
| 233 | 249 | ||
| 234 | desc = irq_desc; | 250 | desc = irq_desc; |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index b98739af4558..a3a5dc9ef346 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -15,17 +15,9 @@ | |||
| 15 | 15 | ||
| 16 | #include "internals.h" | 16 | #include "internals.h" |
| 17 | 17 | ||
| 18 | #ifdef CONFIG_SMP | 18 | #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) |
| 19 | cpumask_var_t irq_default_affinity; | 19 | cpumask_var_t irq_default_affinity; |
| 20 | 20 | ||
| 21 | static int init_irq_default_affinity(void) | ||
| 22 | { | ||
| 23 | alloc_cpumask_var(&irq_default_affinity, GFP_KERNEL); | ||
| 24 | cpumask_setall(irq_default_affinity); | ||
| 25 | return 0; | ||
| 26 | } | ||
| 27 | core_initcall(init_irq_default_affinity); | ||
| 28 | |||
| 29 | /** | 21 | /** |
| 30 | * synchronize_irq - wait for pending IRQ handlers (on other CPUs) | 22 | * synchronize_irq - wait for pending IRQ handlers (on other CPUs) |
| 31 | * @irq: interrupt number to wait for | 23 | * @irq: interrupt number to wait for |
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 45e8541ab7e3..432ee575c9ee 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
| @@ -71,6 +71,14 @@ void hibernation_set_ops(struct platform_hibernation_ops *ops) | |||
| 71 | mutex_unlock(&pm_mutex); | 71 | mutex_unlock(&pm_mutex); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | static bool entering_platform_hibernation; | ||
| 75 | |||
| 76 | bool system_entering_hibernation(void) | ||
| 77 | { | ||
| 78 | return entering_platform_hibernation; | ||
| 79 | } | ||
| 80 | EXPORT_SYMBOL(system_entering_hibernation); | ||
| 81 | |||
| 74 | #ifdef CONFIG_PM_DEBUG | 82 | #ifdef CONFIG_PM_DEBUG |
| 75 | static void hibernation_debug_sleep(void) | 83 | static void hibernation_debug_sleep(void) |
| 76 | { | 84 | { |
| @@ -411,6 +419,7 @@ int hibernation_platform_enter(void) | |||
| 411 | if (error) | 419 | if (error) |
| 412 | goto Close; | 420 | goto Close; |
| 413 | 421 | ||
| 422 | entering_platform_hibernation = true; | ||
| 414 | suspend_console(); | 423 | suspend_console(); |
| 415 | error = device_suspend(PMSG_HIBERNATE); | 424 | error = device_suspend(PMSG_HIBERNATE); |
| 416 | if (error) { | 425 | if (error) { |
| @@ -445,6 +454,7 @@ int hibernation_platform_enter(void) | |||
| 445 | Finish: | 454 | Finish: |
| 446 | hibernation_ops->finish(); | 455 | hibernation_ops->finish(); |
| 447 | Resume_devices: | 456 | Resume_devices: |
| 457 | entering_platform_hibernation = false; | ||
| 448 | device_resume(PMSG_RESTORE); | 458 | device_resume(PMSG_RESTORE); |
| 449 | resume_console(); | 459 | resume_console(); |
| 450 | Close: | 460 | Close: |
