History

sched, trace: Add a tracepoint for IPI-less remote wakeups

Remote wakeups of polling CPUs are a valuable performance improvement; add a tracepoint to make it much easier to verify that they're working.

Andy Lutomirski committed 12 years ago

Commit dfc68f21 parent 84c40702 files · +24 −0Browse files

Unified · Split

2 files
  1. include/trace/events/sched.h +20 −0
  2. kernel/sched/core.c +4 −0
include/trace/events/sched.h+20−0
@@ -530,6 +530,26 @@ TRACE_EVENT(sched_swap_numa, · 529 unmodified lines
530530 __entry->dst_pid, __entry->dst_tgid, __entry->dst_ngid,
531531 __entry->dst_cpu, __entry->dst_nid)
532532 );
533+
534+/*
535+ * Tracepoint for waking a polling cpu without an IPI.
536+ */
537+TRACE_EVENT(sched_wake_idle_without_ipi,
538+
539+ TP_PROTO(int cpu),
540+
541+ TP_ARGS(cpu),
542+
543+ TP_STRUCT__entry(
544+ __field( int, cpu )
545+ ),
546+
547+ TP_fast_assign(
548+ __entry->cpu = cpu;
549+ ),
550+
551+ TP_printk("cpu=%d", __entry->cpu)
552+);
533553 #endif /* _TRACE_SCHED_H */
534554
535555 /* This part must be outside protection */
kernel/sched/core.c+4−0
@@ -564,6 +564,8 @@ void resched_task(struct task_struct *p) · 563 unmodified lines
564564
565565 if (set_nr_and_not_polling(p))
566566 smp_send_reschedule(cpu);
567+ else
568+ trace_sched_wake_idle_without_ipi(cpu);
567569 }
568570
569571 void resched_cpu(int cpu)
@@ -647,6 +649,8 @@ static void wake_up_idle_cpu(int cpu) · 77 unmodified lines
647649 smp_mb();
648650 if (!tsk_is_polling(rq->idle))
649651 smp_send_reschedule(cpu);
652+ else
653+ trace_sched_wake_idle_without_ipi(cpu);
650654 }
651655
652656 static bool wake_up_full_nohz_cpu(int cpu)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t