linux_dsm_epyc7002/arch/x86/kernel/cpu
Seiji Aguchi eddc0e922a x86, trace: Introduce entering/exiting_irq()
When implementing tracepoints in interrupt handers, if the tracepoints are
simply added in the performance sensitive path of interrupt handers,
it may cause potential performance problem due to the time penalty.

To solve the problem, an idea is to prepare non-trace/trace irq handers and
switch their IDTs at the enabling/disabling time.

So, let's introduce entering_irq()/exiting_irq() for pre/post-
processing of each irq handler.

A way to use them is as follows.

Non-trace irq handler:
smp_irq_handler()
{
	entering_irq();		/* pre-processing of this handler */
	__smp_irq_handler();	/*
				 * common logic between non-trace and trace handlers
				 * in a vector.
				 */
	exiting_irq();		/* post-processing of this handler */

}

Trace irq_handler:
smp_trace_irq_handler()
{
	entering_irq();		/* pre-processing of this handler */
	trace_irq_entry();	/* tracepoint for irq entry */
	__smp_irq_handler();	/*
				 * common logic between non-trace and trace handlers
				 * in a vector.
				 */
	trace_irq_exit();	/* tracepoint for irq exit */
	exiting_irq();		/* post-processing of this handler */

}

If tracepoints can place outside entering_irq()/exiting_irq() as follows,
it looks cleaner.

smp_trace_irq_handler()
{
	trace_irq_entry();
	smp_irq_handler();
	trace_irq_exit();
}

But it doesn't work.
The problem is with irq_enter/exit() being called. They must be called before
trace_irq_enter/exit(),  because of the rcu_irq_enter() must be called before
any tracepoints are used, as tracepoints use  rcu to synchronize.

As a possible alternative, we may be able to call irq_enter() first as follows
if irq_enter() can nest.

smp_trace_irq_hander()
{
	irq_entry();
	trace_irq_entry();
	smp_irq_handler();
	trace_irq_exit();
	irq_exit();
}

But it doesn't work, either.
If irq_enter() is nested, it may have a time penalty because it has to check if it
was already called or not. The time penalty is not desired in performance sensitive
paths even if it is tiny.

Signed-off-by: Seiji Aguchi <seiji.aguchi@hds.com>
Link: http://lkml.kernel.org/r/51C3238D.9040706@hds.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
2013-06-20 22:25:01 -07:00
..
mcheck x86, trace: Introduce entering/exiting_irq() 2013-06-20 22:25:01 -07:00
mtrr taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
.gitignore
amd.c x86, CPU, AMD: Drop useless label 2013-04-16 11:50:51 +02:00
bugs_64.c
bugs.c x86: Fold-in trivial check_config function 2013-04-16 11:50:50 +02:00
centaur.c
common.c x86, cpu: Expand cpufeature facility to include cpu bugs 2013-04-02 10:12:52 -07:00
cpu.h
cyrix.c x86, cpu: Convert Cyrix coma bug detection 2013-04-02 10:12:54 -07:00
hypervisor.c x86/apic: Allow x2apic without IR on VMware platform 2013-01-24 13:11:18 +01:00
intel_cacheinfo.c Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-02-19 20:09:48 -08:00
intel.c Merge branch 'x86-kaslr-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-04-30 08:37:24 -07:00
Makefile Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-04-30 08:41:21 -07:00
match.c
mkcapflags.sh mkcapflags.pl: convert to mkcapflags.sh 2013-04-29 15:54:27 -07:00
mshyperv.c x86, hyperv: Handle Xen emulation of Hyper-V more gracefully 2013-04-18 08:59:20 -07:00
perf_event_amd_ibs.c treewide: Replace incomming with incoming in all comments and strings 2013-01-03 16:15:49 +01:00
perf_event_amd_uncore.c perf/x86/amd: Fix AMD NB and L2I "uncore" support 2013-04-22 10:10:55 +02:00
perf_event_amd.c perf/x86/amd: Remove old-style NB counter support from perf_event_amd.c 2013-04-21 17:21:59 +02:00
perf_event_intel_ds.c Merge branch 'perf/urgent' into perf/core 2013-04-21 10:57:33 +02:00
perf_event_intel_lbr.c perf/x86/intel/lbr: Demand proper privileges for PERF_SAMPLE_BRANCH_KERNEL 2013-05-05 10:58:11 +02:00
perf_event_intel_uncore.c Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-05-05 11:37:16 -07:00
perf_event_intel_uncore.h perf/x86/intel: Add Ivy Bridge-EP uncore support 2013-04-21 11:01:24 +02:00
perf_event_intel.c Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-05-05 11:37:16 -07:00
perf_event_knc.c x86: Constify a few items 2013-03-11 15:11:03 +01:00
perf_event_p4.c perf/x86/intel/P4: Robistify P4 PMU types 2013-04-26 09:31:41 +02:00
perf_event_p6.c x86: Constify a few items 2013-03-11 15:11:03 +01:00
perf_event.c perf/x86: Check all MSRs before passing hw check 2013-04-21 11:16:29 +02:00
perf_event.h perf/x86: Add support for PEBS Precise Store 2013-04-01 12:17:06 -03:00
perfctr-watchdog.c perf/x86: Add support for Intel Xeon-Phi Knights Corner PMU 2012-10-04 13:32:37 +02:00
powerflags.c
proc.c x86, cpu: Convert Cyrix coma bug detection 2013-04-02 10:12:54 -07:00
rdrand.c
scattered.c cpufreq: AMD "frequency sensitivity feedback" powersave bias for ondemand governor 2013-04-10 13:19:26 +02:00
topology.c
transmeta.c
umc.c
vmware.c x86/apic: Allow x2apic without IR on VMware platform 2013-01-24 13:11:18 +01:00