Subject: [folded-merged] percpu-add-preemption-checks-to-__this_cpu-ops-fix.patch removed from -mm tree To: cl@xxxxxxxxx,grygorii.strashko@xxxxxx,mm-commits@xxxxxxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Mon, 07 Apr 2014 15:20:10 -0700 The patch titled Subject: preemption_checks: avoid snprintf before checking error conditions has been removed from the -mm tree. Its filename was percpu-add-preemption-checks-to-__this_cpu-ops-fix.patch This patch was dropped because it was folded into percpu-add-preemption-checks-to-__this_cpu-ops.patch ------------------------------------------------------ From: Christoph Lameter <cl@xxxxxxxxx> Subject: preemption_checks: avoid snprintf before checking error conditions snprintf can cause hangs. Move the string processing into the function so that the string operations only occur when necessary after the conditions have been checked. Signed-off-by: Christoph Lameter <cl@xxxxxxxxx> Reported-by: Grygorii Strashko <grygorii.strashko@xxxxxx> Tested-by: Grygorii Strashko <grygorii.strashko@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/smp_processor_id.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff -puN lib/smp_processor_id.c~percpu-add-preemption-checks-to-__this_cpu-ops-fix lib/smp_processor_id.c --- a/lib/smp_processor_id.c~percpu-add-preemption-checks-to-__this_cpu-ops-fix +++ a/lib/smp_processor_id.c @@ -7,7 +7,8 @@ #include <linux/kallsyms.h> #include <linux/sched.h> -notrace static unsigned int check_preemption_disabled(char *what) +notrace static unsigned int check_preemption_disabled(const char *what1, + const char *what2) { int this_cpu = raw_smp_processor_id(); @@ -38,8 +39,8 @@ notrace static unsigned int check_preemp if (!printk_ratelimit()) goto out_enable; - printk(KERN_ERR "BUG: using %s in preemptible [%08x] code: %s/%d\n", - what, preempt_count() - 1, current->comm, current->pid); + printk(KERN_ERR "BUG: using %s%s() in preemptible [%08x] code: %s/%d\n", + what1, what2, preempt_count() - 1, current->comm, current->pid); print_symbol("caller is %s\n", (long)__builtin_return_address(0)); dump_stack(); @@ -52,15 +53,12 @@ out: notrace unsigned int debug_smp_processor_id(void) { - return check_preemption_disabled("smp_processor_id()"); + return check_preemption_disabled("smp_processor_id",""); } EXPORT_SYMBOL(debug_smp_processor_id); notrace void __this_cpu_preempt_check(const char *op) { - char text[40]; - - snprintf(text, sizeof(text), "__this_cpu_%s()", op); - check_preemption_disabled(text); + check_preemption_disabled("__this_cpu_", op); } EXPORT_SYMBOL(__this_cpu_preempt_check); _ Patches currently in -mm which might be from cl@xxxxxxxxx are origin.patch fork-collapse-copy_flags-into-copy_process.patch mm-mempolicy-rename-slab_node-for-clarity.patch mm-mempolicy-remove-per-process-flag.patch res_counter-remove-interface-for-locked-charging-and-uncharging.patch percpu-add-raw_cpu_ops.patch mm-use-raw_cpu-ops-for-determining-current-numa-node.patch modules-use-raw_cpu_write-for-initialization-of-per-cpu-refcount.patch net-replace-__this_cpu_inc-in-routec-with-raw_cpu_inc.patch slub-use-raw_cpu_inc-for-incrementing-statistics.patch vmstat-use-raw_cpu_ops-to-avoid-false-positives-on-preemption-checks.patch percpu-add-preemption-checks-to-__this_cpu-ops.patch percpu-add-preemption-checks-to-__this_cpu-ops-fix-checkpatch-fixes.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html