Merge branch 'hwpoison-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6
* 'hwpoison-2.6.32' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6: HWPOISON: fix invalid page count in printk output HWPOISON: Allow schedule_on_each_cpu() from keventd HWPOISON: fix/proc/meminfo alignment HWPOISON: fix oops on ksm pages HWPOISON: Fix page count leak in hwpoison late kill in do_swap_page HWPOISON: return early on non-LRU pages HWPOISON: Add brief hwpoison description to Documentation HWPOISON: Clean up PR_MCE_KILL interface
This commit is contained in:
+18
-5
@@ -1548,24 +1548,37 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
|
||||
if (arg4 | arg5)
|
||||
return -EINVAL;
|
||||
switch (arg2) {
|
||||
case 0:
|
||||
case PR_MCE_KILL_CLEAR:
|
||||
if (arg3 != 0)
|
||||
return -EINVAL;
|
||||
current->flags &= ~PF_MCE_PROCESS;
|
||||
break;
|
||||
case 1:
|
||||
case PR_MCE_KILL_SET:
|
||||
current->flags |= PF_MCE_PROCESS;
|
||||
if (arg3 != 0)
|
||||
if (arg3 == PR_MCE_KILL_EARLY)
|
||||
current->flags |= PF_MCE_EARLY;
|
||||
else
|
||||
else if (arg3 == PR_MCE_KILL_LATE)
|
||||
current->flags &= ~PF_MCE_EARLY;
|
||||
else if (arg3 == PR_MCE_KILL_DEFAULT)
|
||||
current->flags &=
|
||||
~(PF_MCE_EARLY|PF_MCE_PROCESS);
|
||||
else
|
||||
return -EINVAL;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
error = 0;
|
||||
break;
|
||||
|
||||
case PR_MCE_KILL_GET:
|
||||
if (arg2 | arg3 | arg4 | arg5)
|
||||
return -EINVAL;
|
||||
if (current->flags & PF_MCE_PROCESS)
|
||||
error = (current->flags & PF_MCE_EARLY) ?
|
||||
PR_MCE_KILL_EARLY : PR_MCE_KILL_LATE;
|
||||
else
|
||||
error = PR_MCE_KILL_DEFAULT;
|
||||
break;
|
||||
default:
|
||||
error = -EINVAL;
|
||||
break;
|
||||
|
||||
+19
-2
@@ -685,21 +685,38 @@ EXPORT_SYMBOL(schedule_delayed_work_on);
|
||||
int schedule_on_each_cpu(work_func_t func)
|
||||
{
|
||||
int cpu;
|
||||
int orig = -1;
|
||||
struct work_struct *works;
|
||||
|
||||
works = alloc_percpu(struct work_struct);
|
||||
if (!works)
|
||||
return -ENOMEM;
|
||||
|
||||
/*
|
||||
* when running in keventd don't schedule a work item on itself.
|
||||
* Can just call directly because the work queue is already bound.
|
||||
* This also is faster.
|
||||
* Make this a generic parameter for other workqueues?
|
||||
*/
|
||||
if (current_is_keventd()) {
|
||||
orig = raw_smp_processor_id();
|
||||
INIT_WORK(per_cpu_ptr(works, orig), func);
|
||||
func(per_cpu_ptr(works, orig));
|
||||
}
|
||||
|
||||
get_online_cpus();
|
||||
for_each_online_cpu(cpu) {
|
||||
struct work_struct *work = per_cpu_ptr(works, cpu);
|
||||
|
||||
if (cpu == orig)
|
||||
continue;
|
||||
INIT_WORK(work, func);
|
||||
schedule_work_on(cpu, work);
|
||||
}
|
||||
for_each_online_cpu(cpu)
|
||||
flush_work(per_cpu_ptr(works, cpu));
|
||||
for_each_online_cpu(cpu) {
|
||||
if (cpu != orig)
|
||||
flush_work(per_cpu_ptr(works, cpu));
|
||||
}
|
||||
put_online_cpus();
|
||||
free_percpu(works);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user