aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kprobes.c2
-rw-r--r--kernel/power/disk.c10
-rw-r--r--kernel/power/process.c6
-rw-r--r--kernel/power/swsusp.c33
-rw-r--r--kernel/profile.c4
-rw-r--r--kernel/sched.c7
6 files changed, 33 insertions, 29 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 90c0e82b650c..b0237122b24e 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -574,7 +574,7 @@ static int __init init_kprobes(void)
574 INIT_HLIST_HEAD(&kretprobe_inst_table[i]); 574 INIT_HLIST_HEAD(&kretprobe_inst_table[i]);
575 } 575 }
576 576
577 err = arch_init(); 577 err = arch_init_kprobes();
578 if (!err) 578 if (!err)
579 err = register_die_notifier(&kprobe_exceptions_nb); 579 err = register_die_notifier(&kprobe_exceptions_nb);
580 580
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index fb8de63c2919..c51a4d96d4eb 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -234,6 +234,16 @@ static int software_resume(void)
234{ 234{
235 int error; 235 int error;
236 236
237 if (!swsusp_resume_device) {
238 if (!strlen(resume_file))
239 return -ENOENT;
240 swsusp_resume_device = name_to_dev_t(resume_file);
241 pr_debug("swsusp: Resume From Partition %s\n", resume_file);
242 } else {
243 pr_debug("swsusp: Resume From Partition %d:%d\n",
244 MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
245 }
246
237 if (noresume) { 247 if (noresume) {
238 /** 248 /**
239 * FIXME: If noresume is specified, we need to find the partition 249 * FIXME: If noresume is specified, we need to find the partition
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 0a086640bcfc..3bd0d261818f 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -59,6 +59,7 @@ int freeze_processes(void)
59 int todo; 59 int todo;
60 unsigned long start_time; 60 unsigned long start_time;
61 struct task_struct *g, *p; 61 struct task_struct *g, *p;
62 unsigned long flags;
62 63
63 printk( "Stopping tasks: " ); 64 printk( "Stopping tasks: " );
64 start_time = jiffies; 65 start_time = jiffies;
@@ -66,12 +67,9 @@ int freeze_processes(void)
66 todo = 0; 67 todo = 0;
67 read_lock(&tasklist_lock); 68 read_lock(&tasklist_lock);
68 do_each_thread(g, p) { 69 do_each_thread(g, p) {
69 unsigned long flags;
70 if (!freezeable(p)) 70 if (!freezeable(p))
71 continue; 71 continue;
72 if ((frozen(p)) || 72 if (frozen(p))
73 (p->state == TASK_TRACED) ||
74 (p->state == TASK_STOPPED))
75 continue; 73 continue;
76 74
77 freeze(p); 75 freeze(p);
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index c285fc5a2320..7d7801cd01f0 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -869,13 +869,6 @@ extern asmlinkage int swsusp_arch_resume(void);
869 869
870asmlinkage int swsusp_save(void) 870asmlinkage int swsusp_save(void)
871{ 871{
872 int error = 0;
873
874 if ((error = swsusp_swap_check())) {
875 printk(KERN_ERR "swsusp: FATAL: cannot find swap device, try "
876 "swapon -a!\n");
877 return error;
878 }
879 return suspend_prepare_image(); 872 return suspend_prepare_image();
880} 873}
881 874
@@ -892,14 +885,20 @@ int swsusp_suspend(void)
892 * at resume time, and evil weirdness ensues. 885 * at resume time, and evil weirdness ensues.
893 */ 886 */
894 if ((error = device_power_down(PMSG_FREEZE))) { 887 if ((error = device_power_down(PMSG_FREEZE))) {
895 printk(KERN_ERR "Some devices failed to power down, aborting suspend\n");
896 local_irq_enable(); 888 local_irq_enable();
897 swsusp_free();
898 return error; 889 return error;
899 } 890 }
891
892 if ((error = swsusp_swap_check())) {
893 printk(KERN_ERR "swsusp: FATAL: cannot find swap device, try "
894 "swapon -a!\n");
895 local_irq_enable();
896 return error;
897 }
898
900 save_processor_state(); 899 save_processor_state();
901 if ((error = swsusp_arch_suspend())) 900 if ((error = swsusp_arch_suspend()))
902 swsusp_free(); 901 printk("Error %d suspending\n", error);
903 /* Restore control flow magically appears here */ 902 /* Restore control flow magically appears here */
904 restore_processor_state(); 903 restore_processor_state();
905 BUG_ON (nr_copy_pages_check != nr_copy_pages); 904 BUG_ON (nr_copy_pages_check != nr_copy_pages);
@@ -1166,9 +1165,9 @@ static int bio_write_page(pgoff_t page_off, void * page)
1166static const char * sanity_check(void) 1165static const char * sanity_check(void)
1167{ 1166{
1168 dump_info(); 1167 dump_info();
1169 if(swsusp_info.version_code != LINUX_VERSION_CODE) 1168 if (swsusp_info.version_code != LINUX_VERSION_CODE)
1170 return "kernel version"; 1169 return "kernel version";
1171 if(swsusp_info.num_physpages != num_physpages) 1170 if (swsusp_info.num_physpages != num_physpages)
1172 return "memory size"; 1171 return "memory size";
1173 if (strcmp(swsusp_info.uts.sysname,system_utsname.sysname)) 1172 if (strcmp(swsusp_info.uts.sysname,system_utsname.sysname))
1174 return "system type"; 1173 return "system type";
@@ -1356,16 +1355,6 @@ int swsusp_check(void)
1356{ 1355{
1357 int error; 1356 int error;
1358 1357
1359 if (!swsusp_resume_device) {
1360 if (!strlen(resume_file))
1361 return -ENOENT;
1362 swsusp_resume_device = name_to_dev_t(resume_file);
1363 pr_debug("swsusp: Resume From Partition %s\n", resume_file);
1364 } else {
1365 pr_debug("swsusp: Resume From Partition %d:%d\n",
1366 MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
1367 }
1368
1369 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ); 1358 resume_bdev = open_by_devnum(swsusp_resume_device, FMODE_READ);
1370 if (!IS_ERR(resume_bdev)) { 1359 if (!IS_ERR(resume_bdev)) {
1371 set_blocksize(resume_bdev, PAGE_SIZE); 1360 set_blocksize(resume_bdev, PAGE_SIZE);
diff --git a/kernel/profile.c b/kernel/profile.c
index ad8cbb75ffa2..f89248e6d704 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -35,11 +35,11 @@ struct profile_hit {
35#define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ) 35#define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ)
36 36
37/* Oprofile timer tick hook */ 37/* Oprofile timer tick hook */
38int (*timer_hook)(struct pt_regs *); 38int (*timer_hook)(struct pt_regs *) __read_mostly;
39 39
40static atomic_t *prof_buffer; 40static atomic_t *prof_buffer;
41static unsigned long prof_len, prof_shift; 41static unsigned long prof_len, prof_shift;
42static int prof_on; 42static int prof_on __read_mostly;
43static cpumask_t prof_cpu_mask = CPU_MASK_ALL; 43static cpumask_t prof_cpu_mask = CPU_MASK_ALL;
44#ifdef CONFIG_SMP 44#ifdef CONFIG_SMP
45static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits); 45static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
diff --git a/kernel/sched.c b/kernel/sched.c
index 5f2182d42241..4107db0dc091 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3877,6 +3877,13 @@ asmlinkage long sys_sched_yield(void)
3877 3877
3878static inline void __cond_resched(void) 3878static inline void __cond_resched(void)
3879{ 3879{
3880 /*
3881 * The BKS might be reacquired before we have dropped
3882 * PREEMPT_ACTIVE, which could trigger a second
3883 * cond_resched() call.
3884 */
3885 if (unlikely(preempt_count()))
3886 return;
3880 do { 3887 do {
3881 add_preempt_count(PREEMPT_ACTIVE); 3888 add_preempt_count(PREEMPT_ACTIVE);
3882 schedule(); 3889 schedule();