Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Thomas Gleixner:
"Two small fixes for kprobes and perf:

- Prevent a deadlock in kprobe_optimizer() causes by reverse lock
ordering

- Fix a comment typo"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
kprobes: Fix potential deadlock in kprobe_optimizer()
perf/x86: Fix typo in comment

+5 -5
+1 -1
arch/x86/events/core.c
··· 1236 1236 * Add a single event to the PMU. 1237 1237 * 1238 1238 * The event is added to the group of enabled events 1239 - * but only if it can be scehduled with existing events. 1239 + * but only if it can be scheduled with existing events. 1240 1240 */ 1241 1241 static int x86_pmu_add(struct perf_event *event, int flags) 1242 1242 {
+4 -4
kernel/kprobes.c
··· 470 470 */ 471 471 static void do_optimize_kprobes(void) 472 472 { 473 + lockdep_assert_held(&text_mutex); 473 474 /* 474 475 * The optimization/unoptimization refers online_cpus via 475 476 * stop_machine() and cpu-hotplug modifies online_cpus. ··· 488 487 list_empty(&optimizing_list)) 489 488 return; 490 489 491 - mutex_lock(&text_mutex); 492 490 arch_optimize_kprobes(&optimizing_list); 493 - mutex_unlock(&text_mutex); 494 491 } 495 492 496 493 /* ··· 499 500 { 500 501 struct optimized_kprobe *op, *tmp; 501 502 503 + lockdep_assert_held(&text_mutex); 502 504 /* See comment in do_optimize_kprobes() */ 503 505 lockdep_assert_cpus_held(); 504 506 ··· 507 507 if (list_empty(&unoptimizing_list)) 508 508 return; 509 509 510 - mutex_lock(&text_mutex); 511 510 arch_unoptimize_kprobes(&unoptimizing_list, &freeing_list); 512 511 /* Loop free_list for disarming */ 513 512 list_for_each_entry_safe(op, tmp, &freeing_list, list) { ··· 523 524 } else 524 525 list_del_init(&op->list); 525 526 } 526 - mutex_unlock(&text_mutex); 527 527 } 528 528 529 529 /* Reclaim all kprobes on the free_list */ ··· 554 556 { 555 557 mutex_lock(&kprobe_mutex); 556 558 cpus_read_lock(); 559 + mutex_lock(&text_mutex); 557 560 /* Lock modules while optimizing kprobes */ 558 561 mutex_lock(&module_mutex); 559 562 ··· 582 583 do_free_cleaned_kprobes(); 583 584 584 585 mutex_unlock(&module_mutex); 586 + mutex_unlock(&text_mutex); 585 587 cpus_read_unlock(); 586 588 mutex_unlock(&kprobe_mutex); 587 589