Allow disabling perf on x86
Subsystems (5)
This patchkit allows to disable perf events on x86. Requires various changes to avoid dependencies.
-Andi
PATCH 1/6 perf, x86, amd: Move __get_ibs_caps into common amd CPU file
From: Andi Kleen <[email protected]>
__get_ibs_caps is used by both oprofile and perf events. This causes oprofile to be dependent on perf.
__get_ibs_caps is actually only a few lines, so we can easily move that to the standard AMD CPU initialization file.
It will be always compiled in this way, but it's far better than requiring perf always to be compiled in for this.
--- arch/x86/include/asm/perf_event.h | 2 ++ arch/x86/kernel/cpu/amd.c | 27 +++++++++++++++++++++++++++ arch/x86/kernel/cpu/perf_event_amd_ibs.c | 23 ----------------------- arch/x86/oprofile/op_model_amd.c | 4 +++- 4 files changed, 32 insertions(+), 24 deletions(-)
arch/x86/include/asm/perf_event.h +2 -0
@@ -198,6 +198,8 @@ struct x86_pmu_capability {#define IBS_OP_MAX_CNT_EXT 0x007FFFFFULL/* not a register bit mask */ #define IBS_RIP_INVALID (1ULL<<38) +extern u32 __get_ibs_caps (void ); +#ifdef CONFIG_X86_LOCAL_APIC extern u32 get_ibs_caps (void );#else
arch/x86/kernel/cpu/amd.c +27 -0
@@ -16,6 +16,8 @@# include <asm/cacheflush.h> #endif +#include <asm/perf_event.h> +#include "cpu.h" static inline int rdmsrl_amd_safe (unsigned msr,unsigned long long *p)
@@ -909,3 +911,28 @@ static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum)return false; } + + +/* IBS - apic initialization, for perf and oprofile */ + +u32 __get_ibs_caps (void ) +{ +u32 caps; +unsigned int max_level; + +if (!boot_cpu_has (X86_FEATURE_IBS )) +return 0 ; + +/* check IBS cpuid feature flags */ + max_level =cpuid_eax (0x80000000 ); +if (max_level <IBS_CPUID_FEATURES ) +return IBS_CAPS_DEFAULT ; + + caps =cpuid_eax (IBS_CPUID_FEATURES ); +if (!(caps &IBS_CAPS_AVAIL )) +/* cpuid flags not valid */ +return IBS_CAPS_DEFAULT ; + +return caps; +} +EXPORT_SYMBOL (__get_ibs_caps);
arch/x86/kernel/cpu/perf_event_amd_ibs.c +0 -23
@@ -664,29 +664,6 @@ static __init int perf_event_ibs_init(void) { return 0; }#endif -/* IBS - apic initialization, for perf and oprofile */ - -static __init u32 __get_ibs_caps (void ) -{ -u32 caps; -unsigned int max_level; - -if (!boot_cpu_has (X86_FEATURE_IBS )) -return 0 ; - -/* check IBS cpuid feature flags */ - max_level =cpuid_eax (0x80000000 ); -if (max_level <IBS_CPUID_FEATURES ) -return IBS_CAPS_DEFAULT ; - - caps =cpuid_eax (IBS_CPUID_FEATURES ); -if (!(caps &IBS_CAPS_AVAIL )) -/* cpuid flags not valid */ -return IBS_CAPS_DEFAULT ; - -return caps; -} -u32 get_ibs_caps (void ) {return ibs_caps;
arch/x86/oprofile/op_model_amd.c +3 -1
@@ -26,6 +26,8 @@#include <asm/processor.h> #include <asm/cpufeature.h> +#include <asm/perf_event.h> /* for __get_ibs_caps */ +#include "op_x86_model.h" #include "op_counter.h"
@@ -446,7 +448,7 @@ static void op_amd_stop(struct op_msrs const * const msrs)static void init_ibs (void ) { - ibs_caps =get_ibs_caps (); + ibs_caps =__get_ibs_caps ();if (!ibs_caps)return ;
Signature · 1 line
1.8.3.1
PATCH 2/6 perf, x86: Make perf amd ibs code depend on PERF_EVENTS and SUP_AMD
In reply to Andi KleenFrom: Andi Kleen <[email protected]>
Now that oprofile doesn't need the AMD IBS perf code anymore, we can make that code dependent on PERF_EVENTS and AMD CPU support, instead of unconditionally compiling it in.
--- arch/x86/kernel/cpu/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/Makefile +4 -1
@@ -37,13 +37,16 @@ endif obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_uncore.o +ifdef CONFIG_X86_LOCAL_APIC +obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_ibs.o +endif endif obj-$(CONFIG_X86_MCE) += mcheck/ obj-$(CONFIG_MTRR) += mtrr/ -obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o perf_event_amd_ibs.o +obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
Signature · 1 line
1.8.3.1
PATCH 3/6 x86, ptrace: Ifdef HW_BREAKPOINTS code in ptrace
In reply to Andi KleenFrom: Andi Kleen <[email protected]>
Add ifdefs on CONFIG_HW_BREAKPOINTS to the hardware break point code in x86 ptrace.c. This prepares this file for being able to disable HW_BREAKPOINTS.
The only debug register that needs to be handled without break points is DR6, so do that in a simple separate function without breakpoints.
--- arch/x86/kernel/ptrace.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/x86/kernel/ptrace.c +30 -0
@@ -561,6 +561,8 @@ static int genregs_set(struct task_struct *target,return ret; } +#ifdef CONFIG_HW_BREAKPOINTS +static void ptrace_triggered (struct perf_event *bp,struct perf_sample_data *data,struct pt_regs *regs)
@@ -778,6 +780,34 @@ static int ptrace_set_debugreg(struct task_struct *tsk, int n, return rc; } +#else + +/* Without breakpoints only handle DR6 */ +static unsigned long ptrace_get_debugreg (struct task_struct *tsk,int n) +{ +struct thread_struct *thread = &tsk->thread; + +if (n ==6 ) +return thread->debugreg6; +return 0 ; +} + +/* Without breakpoints only handle DR6 */ +static int ptrace_set_debugreg (struct task_struct *tsk,int n, +unsigned long val) +{ +struct thread_struct *thread = &tsk->thread; +int rc = -EIO ; + +if (n ==6 ) { + thread->debugreg6 = val; + rc =0 ; + } +return rc; +} + +#endif +/* * These access the current or another (stopped) task's io permission * bitmap for debugging or core dump.
Signature · 1 line
1.8.3.1
PATCH 4/6 trace: Make UPROBES depend on PERF_EVENTS
In reply to Andi KleenFrom: Andi Kleen <[email protected]>
UPROBES need the perf events code, so add a dependency from PERF_EVENTS to UPROBES.
--- kernel/trace/Kconfig | 1 + 1 file changed, 1 insertion(+)
kernel/trace/Kconfig +1 -0
@@ -424,6 +424,7 @@ config UPROBE_EVENT bool "Enable uprobes-based dynamic events" depends on ARCH_SUPPORTS_UPROBES depends on MMU + depends on PERF_EVENTS select UPROBES select PROBE_EVENTS select TRACING
Signature · 1 line
1.8.3.1
Steven Rostedt
maintainerRe: [PATCH 4/6] trace: Make UPROBES depend on PERF_EVENTS
Quoted 4 lines · On Fri, 4 Oct 2013 14:39:46 -0700 Andi Kleen <[email protected]> wrote:
From: Andi Kleen <[email protected]>
UPROBES need the perf events code, so add a dependency from
PERF_EVENTSto UPROBES.
Can you please be a bit more specific on what uprobes requires of perf? That is, what part of the perf events code is needed, and why?
-- Steve
Quoted 19 lines
Signed-off-by Andi Kleen <[email protected]>--- kernel/trace/Kconfig | 1 + 1 file changed, 1 insertion(+)kernel/trace/Kconfig +1
-0@@ -424,6 +424,7 @@ config UPROBE_EVENT bool "Enable uprobes-based dynamic events" depends on ARCH_SUPPORTS_UPROBES depends on MMU + depends on PERF_EVENTS select UPROBES select PROBE_EVENTS select TRACING
Re: [PATCH 4/6] trace: Make UPROBES depend on PERF_EVENTS
Quoted 10 lines · Steven Rostedt
Quoted 4 lines · On Fri, 4 Oct 2013 14:39:46 -0700 Andi Kleen <[email protected]> wrote:
From: Andi Kleen <[email protected]>
UPROBES need the perf events code, so add a dependency from
PERF_EVENTSto UPROBES.Can you please be a bit more specific on what uprobes requires of perf? That is, what part of the perf events code is needed, and why?
Without this dependency, when UPROBE_EVENT is enabled and PERF_EVENTS disabled I first get
warning: (UPROBE_EVENT) selects UPROBES which has unmet direct dependencies (UPROBE_EVENT && PERF_EVENTS)
warning: (UPROBE_EVENT) selects UPROBES which has unmet direct dependencies (UPROBE_EVENT && PERF_EVENTS)
and then later lots of errors like
arch/x86/built-in.o: In function `do_notify_resume':/home/ak/lsrc/git/linux-2.6/arch/x86/kernel/signal.c:743: undefined reference to uprobe_notify_resume' arch/x86/built-in.o: In function arch_uprobe_exception_notify':/home/ak/lsrc/git/linux-2.6/arch/x86/kernel/uprobes.c:637: undefined reference to uprobe_pre_sstep_notifier' /home/ak/lsrc/git/linux-2.6/arch/x86/kernel/uprobes.c:643: undefined reference to uprobe_post_sstep_notifier' kernel/built-in.o: In function `mmput':/home/ak/lsrc/git/linux-2.6/kernel/fork.c:608: undefined reference to `uprobe_clear_state'
I'm not fully sure why UPROBES has the && PERF_EVENTS; I didn't add that.
-Andi
PATCH 5/6 x86, kgdb: Support compiling without hardware break points
In reply to Andi KleenFrom: Andi Kleen <[email protected]>
Add some ifdefs to support compiling without CONFIG_HW_BREAKPOINTS. HW_BREAKPOINTS pulls in all of perf, and presumably there are some use cases where people want to debug without perf.
The standard software breakpoints still work of course.
--- arch/x86/kernel/cpu/Makefile | 2 +- arch/x86/kernel/kgdb.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/Makefile +1 -1
@@ -46,7 +46,7 @@ endif obj-$(CONFIG_X86_MCE) += mcheck/ obj-$(CONFIG_MTRR) += mtrr/ -obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o +obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o obj-$(CONFIG_HYPERVISOR_GUEST) += vmware.o hypervisor.o mshyperv.o
arch/x86/kernel/kgdb.c +12 -0
@@ -193,6 +193,8 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) gdb_regs[GDB_SP ] = p->thread.sp; } +#ifdef CONFIG_HW_BREAKPOINTS + static struct hw_breakpoint { unsigned enabled; unsigned long addr;
@@ -419,6 +421,8 @@ static void kgdb_disable_hw_debug(struct pt_regs *regs) } } +#endif +#ifdef CONFIG_SMP /** * kgdb_roundup_cpus - Get other CPUs into a holding pattern
@@ -639,6 +643,8 @@ out:return retval; } +#ifdef CONFIG_HW_BREAKPOINTS +static void kgdb_hw_overflow_handler (struct perf_event *event,struct perf_sample_data *data,struct pt_regs *regs) {
@@ -689,6 +695,8 @@ void kgdb_arch_late(void) } } +#endif +/** * kgdb_arch_exit - Perform any architecture specific uninitalization. *
@@ -697,6 +705,7 @@ void kgdb_arch_late(void)*/ void kgdb_arch_exit (void ) { +#ifdef CONFIG_HW_BREAKPOINTS int i;for (i =0 ; i <4 ; i++) {if (breakinfo[i].pev) {
@@ -704,6 +713,7 @@ void kgdb_arch_exit(void) breakinfo[i].pev = NULL; } } +#endif unregister_nmi_handler (NMI_UNKNOWN ,"kgdb" );unregister_nmi_handler (NMI_LOCAL ,"kgdb" );unregister_die_notifier (&kgdb_notifier);
@@ -807,9 +817,11 @@ struct kgdb_arch arch_kgdb_ops = {/* Breakpoint instruction: */ .gdb_bpt_instr = { 0xcc }, .flags =KGDB_HW_BREAKPOINT , +#ifdef CONFIG_HW_BREAKPOINTS .set_hw_breakpoint = kgdb_set_hw_break, .remove_hw_breakpoint = kgdb_remove_hw_break, .disable_hw_break = kgdb_disable_hw_debug, .remove_all_hw_break = kgdb_remove_all_hw_break, .correct_hw_break = kgdb_correct_hw_break, +#endif };
Signature · 1 line
1.8.3.1
PATCH 6/6 x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Andi KleenFrom: Andi Kleen <[email protected]>
As suggested by Ingo.
Make HW_BREAKPOINTS a config option. HW_BREAKPOINTS depends on perf. This allows disabling PERF_EVENTS for systems that don't need it (e.g. anything not used for development)
Disabling PERF_EVENTS saves over 700k of kernel text (~5% of my config) and significant data/bss:
text data bss dec hex filename
13692640 1922416 1478656 17093712 104d450 obj/vmlinux
12980092 1787544 1470464 16238100 f7c614 obj-noperf/vmlinux
I didn't make it depend on CONFIG_EXPERT for now, as the system should be very usable even without it. To actually disable perf a couple of options depending on it need to be disabled, including KVM and HW_BREAKPOINTS.
Longer term it would be probably nice to have modular perf.
--- arch/x86/Kconfig | 11 ++++++++--- arch/x86/kernel/Makefile | 3 ++- arch/x86/kvm/Kconfig | 1 + 3 files changed, 11 insertions(+), 4 deletions(-)
arch/x86/Kconfig +8 -3
@@ -67,9 +67,6 @@ config X86 select HAVE_KERNEL_XZ select HAVE_KERNEL_LZO select HAVE_KERNEL_LZ4 - select HAVE_HW_BREAKPOINT - select HAVE_MIXED_BREAKPOINTS_REGS - select PERF_EVENTS select HAVE_PERF_EVENTS_NMI select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP
@@ -602,6 +599,14 @@ config SCHED_OMIT_FRAME_POINTER If in doubt, say "Y". +config HW_BREAKPOINTS + bool "Enable hardware breakpoints support" + select HAVE_HW_BREAKPOINT + select HAVE_MIXED_BREAKPOINTS_REGS + ---help--- + Enable support for x86 hardware breakpoints for debuggers + and perf. This will implicitly enable perf-events. + menuconfig HYPERVISOR_GUEST bool "Linux guest support" ---help---
arch/x86/kernel/Makefile +2 -1
@@ -31,7 +31,7 @@ obj-$(CONFIG_X86_64) += vsyscall_64.o obj-$(CONFIG_X86_64) += vsyscall_emu_64.o obj-y += bootflag.o e820.o obj-y += pci-dma.o quirks.o topology.o kdebugfs.o -obj-y += alternative.o i8253.o pci-nommu.o hw_breakpoint.o +obj-y += alternative.o i8253.o pci-nommu.o obj-y += tsc.o io_delay.o rtc.o obj-y += pci-iommu_table.o obj-y += resource.o
@@ -73,6 +73,7 @@ obj-$(CONFIG_DOUBLEFAULT) += doublefault.o obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_VM86) += vm86_32.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +obj-$(CONFIG_HW_BREAKPOINTS) += hw_breakpoint.o obj-$(CONFIG_HPET_TIMER) += hpet.o obj-$(CONFIG_APB_TIMER) += apb_timer.o
arch/x86/kvm/Kconfig +1 -0
@@ -36,6 +36,7 @@ config KVM select TASKSTATS select TASK_DELAY_ACCT select PERF_EVENTS + select HW_BREAKPOINTS select HAVE_KVM_MSI select HAVE_KVM_CPU_RELAX_INTERCEPT ---help---
Signature · 1 line
1.8.3.1
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 15 lines · Andi Kleen
From: Andi Kleen <[email protected]>
As suggested by Ingo.
Make
HW_BREAKPOINTSa config option.HW_BREAKPOINTSdepends on perf. This allows disablingPERF_EVENTSfor systems that don't need it (e.g. anything not used for development)Disabling
PERF_EVENTSsaves over 700k of kernel text (~5% of my config) and significant data/bss:text data bss dec hex filename
13692640 1922416 1478656 17093712 104d450 obj/vmlinux
12980092 1787544 1470464 16238100 f7c614 obj-noperf/vmlinux
Quoted 6 lines
I didn't make it depend on
CONFIG_EXPERTfor now, as the system should be very usable even without it. To actually disable perf a couple of options depending on it need to be disabled, including KVM andHW_BREAKPOINTS.Longer term it would be probably nice to have modular perf.
I'm personally not against the idea of allowing hw breakpoint support
to be disabled but hpa did not like much the idea. I must say he had
valid concerns though, see the thread of this patchset: https://lkml.org/lkml/2011/7/14/163
IMHO, a better solution would be to make the hw breakpoint subsystem work without using perf.
I mean, perf should use the hw breakpoint, but hw breakpoint shouldn't use perf, (in fact that's what we agreed on with hpa IIRC).
But right now there is a kind of circular dependency between both that makes perf always built-in in x86. I'm all for solving that by making hw breakpoint independant from perf, but I think Ingo had mixed feelings about doing it that way. And he had valid concerns on that as well.
So we are a bit stuck :)
Also some comments below:
Quoted 15 lines
--- arch/x86/Kconfig | 11 ++++++++--- arch/x86/kernel/Makefile | 3 ++- arch/x86/kvm/Kconfig | 1 + 3 files changed, 11 insertions(+), 4 deletions(-)arch/x86/Kconfig +0
-0
arch/x86/Kconfig config X86 · line 71
Quoted 5 lines
arch/x86/Kconfig +0
-2@@ -67,9 +67,6 @@ config X86 select HAVE_KERNEL_XZ select HAVE_KERNEL_LZO select HAVE_KERNEL_LZ4 - select HAVE_HW_BREAKPOINT - select HAVE_MIXED_BREAKPOINTS_REGS
I really wish we stick the HAVE_*Kconfig symbols to the simple role of expressing a constant arch ability, not a variable user choice...
The user choice itself is CONFIG_HW_BREAKPOINT, the frontend, which depends on the arch ability that is CONFIG_HAVE_HW_BREAKPOINT, the backend.
ie, that's what I did in this patchset
https://lkml.org/lkml/2011/7/14/163
Thanks.
Quoted 55 lines
arch/x86/Kconfig +8
-1- select PERF_EVENTS select HAVE_PERF_EVENTS_NMI select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP@@ -602,6 +599,14 @@ config SCHED_OMIT_FRAME_POINTER If in doubt, say "Y". +config HW_BREAKPOINTS + bool "Enable hardware breakpoints support" + select HAVE_HW_BREAKPOINT + select HAVE_MIXED_BREAKPOINTS_REGS + ---help--- + Enable support for x86 hardware breakpoints for debuggers + and perf. This will implicitly enable perf-events. + menuconfig HYPERVISOR_GUEST bool "Linux guest support" ---help---arch/x86/kernel/Makefile +2
-1@@ -31,7 +31,7 @@ obj-$(CONFIG_X86_64) += vsyscall_64.o obj-$(CONFIG_X86_64) += vsyscall_emu_64.o obj-y += bootflag.o e820.o obj-y += pci-dma.o quirks.o topology.o kdebugfs.o -obj-y += alternative.o i8253.o pci-nommu.o hw_breakpoint.o +obj-y += alternative.o i8253.o pci-nommu.o obj-y += tsc.o io_delay.o rtc.o obj-y += pci-iommu_table.o obj-y += resource.o@@ -73,6 +73,7 @@ obj-$(CONFIG_DOUBLEFAULT) += doublefault.o obj-$(CONFIG_KGDB) += kgdb.o obj-$(CONFIG_VM86) += vm86_32.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +obj-$(CONFIG_HW_BREAKPOINTS) += hw_breakpoint.o obj-$(CONFIG_HPET_TIMER) += hpet.o obj-$(CONFIG_APB_TIMER) += apb_timer.oarch/x86/kvm/Kconfig +1
-0@@ -36,6 +36,7 @@ config KVM select TASKSTATS select TASK_DELAY_ACCT select PERF_EVENTS + select HW_BREAKPOINTS select HAVE_KVM_MSI select HAVE_KVM_CPU_RELAX_INTERCEPT ---help---Signature · 1 line
1.8.3.1
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Andi KleenQuoted 3 lines · Andi Kleen
From: Andi Kleen <[email protected]>
As suggested by Ingo.
No, you haven't read my suggestion carefully enough so NAK.
Thanks,
Ingo
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 8 lines · Ingo Molnar
Quoted 3 lines · Andi Kleen
From: Andi Kleen <[email protected]>
As suggested by Ingo.
No, you haven't read my suggestion carefully enough so NAK.
Ok I trust you will do a better solution then to save the 700+k text. Ball is in your court.
-Andi
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 4 lines · Andi Kleen
Quoted 3 lines · Ingo Molnar
* Andi Kleen <[email protected]> wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
From: Andi Kleen <[email protected]>
As suggested by Ingo.
No, you haven't read my suggestion carefully enough so NAK.
Ok I trust you will do a better solution then to save the 700+k text. Ball is in your court.
Ok I have two choices in mind.
1) make breakpoints independant from perf. The drawback is that we must then add seperate hooks on context switch for ptrace breakpoints. OTOH we get rid of the perf -> breakpoint -> perf circular dependency, which is the very controversial thing.
2) Build breakpoints conditionally (depend on CONFIG_EXPERT). hpa didn't like much that solution because breakpoints is an elementary debugging feature that is too useful to be unbuild.
Both ways can allow us to disable perf on x86.
We just need to agree on a solution and I'll happily work on it.
Ingo, others?
Peter Zijlstra
maintainerRe: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 4 lines · Frederic Weisbecker
1) make breakpoints independant from perf. The drawback is that we must then add seperate hooks on context switch for ptrace breakpoints. OTOH we get rid of the perf -> breakpoint -> perf circular dependency, which is the very controversial thing.
we used to have this in __switch_to_xtra(), right?
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 7 lines · Peter Zijlstra
Quoted 4 lines · Frederic Weisbecker
1) make breakpoints independant from perf. The drawback is that we must then add seperate hooks on context switch for ptrace breakpoints. OTOH we get rid of the perf -> breakpoint -> perf circular dependency, which is the very controversial thing.
we used to have this in
__switch_to_xtra(), right?
Right.
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Peter ZijlstraQuoted 7 lines · Peter Zijlstra
Quoted 4 lines · Frederic Weisbecker
1) make breakpoints independant from perf. The drawback is that we must then add seperate hooks on context switch for ptrace breakpoints. OTOH we get rid of the perf -> breakpoint -> perf circular dependency, which is the very controversial thing.
we used to have this in
__switch_to_xtra(), right?
Right.
And then it got replaced by perf events scheduling.
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 7 lines · Frederic Weisbecker
Quoted 6 lines · Peter Zijlstra
Quoted 4 lines · Frederic Weisbecker
1) make breakpoints independant from perf. The drawback is that we must then add seperate hooks on context switch for ptrace breakpoints. OTOH we get rid of the perf -> breakpoint -> perf circular dependency, which is the very controversial thing.
Quoted 5 lines
Quoted 1 line
we used to have this in
__switch_to_xtra(), right?Right.
And then it got replaced by perf events scheduling.
Which we have anyway - so this moved complexity out the contex switch path, for the common case where no hardware-breakpoints are used.
Thanks,
Ingo
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Andi KleenQuoted 8 lines · Andi Kleen
From: Andi Kleen <[email protected]>
As suggested by Ingo.
Make
HW_BREAKPOINTSa config option.HW_BREAKPOINTSdepends on perf. This allows disablingPERF_EVENTSfor systems that don't need it (e.g. anything not used for development)
Quoted 6 lines
Disabling
PERF_EVENTSsaves over 700k of kernel text (~5% of my config) and significant data/bss:text data bss dec hex filename
13692640 1922416 1478656 17093712 104d450 obj/vmlinux
12980092 1787544 1470464 16238100 f7c614 obj-noperf/vmlinux
Btw., could you send me your .config so I can investigate this?
Thanks,
Ingo
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 5 lines · Ingo Molnar
Quoted 3 lines · Andi Kleen
text data bss dec hex filename
13692640 1922416 1478656 17093712 104d450 obj/vmlinux
12980092 1787544 1470464 16238100 f7c614 obj-noperf/vmlinux
[...]
Quoted 4 lines
Quoted 2 lines
Ok I trust you will do a better solution then to save the 700+k text. Ball is in your court.
Btw., could you send me your .config so I can investigate this?
Ok, you sent me your .config off-list - I won't re-post the full config, but it can be reproduced by others fairly accurately by appending the attached list of config symbols to a 'make defconfig' x86-64 .config and running 'make oldconfig'.
So I test-built a config close to your config with both tracing and perf on and off (note, I had OPROFILE and KVM in a module), and got the following kernel sizes:
text data bss dec hex filename
====================================================================================
12081246 1279656 1003520 14364422 db2f06 vmlinux.perf-OFF.tracing-OFF 12979238 1785192 1150976 15915406 f2d98e vmlinux.perf-OFF.tracing-ON 12232758 1325424 1003520 14561702 de31a6 vmlinux.perf-ON.tracing-OFF 13223817 1877872 1150976 16252665 f7fef9 vmlinux.perf-ON.tracing-ON
Firstly, your 'perf increases vmlinux size by 700k' result does not seem to reproduce, at all. [*]
[ Are you sure you made the measurement correctly? Please send me _both_
configs you used for the test, one with perf enabled, and the other one with perf disabled, so I can double check it. I suppose you tested a recent Linus kernel with your hardware-breakpoint patches applied. ]
Secondly and more importantly, visualized with relative sizes, in a feature matrix, makes it clearer what's going on with vmlinux .text:
perf-OFF perf-ON
ftrace-OFF 0 +151k
ftrace-ON +897k +1142k
So basically ftrace is causing a big chunk of the instrumentation size increase. With tons of tracers and lots of kernel subsystems built into your .config that's a lot of nice instrumentation functionality and it's thus also a natural end result IMO.
The base cost of perf is +151k - not small but a far cry from your claimed +700k ...
In any case, on one hand I obviously welcome genuine kernel size reductions, on the other hand what you did in these patches wasn't really size reduction usable to too many people: all distros enable perf and tracing and very few kernel developers are left who are still using oprofile. You fought the symptom, not the reason.
So my NAK against your series stands. To sum up the technical reasons:
- you blaming +700k on perf alone is wrong, or at most a red herring
- your patches might break apps/ABI
- your patch-set unnecessarily complicates things, making the kernel less maintainable
- details of your patch-set are broken as well, see the discussions
( There might be more reasons, this is just off the top of my head.
Any of these reasons would be enough to not apply your patches.)
You might want to concentrate your efforts from fighting perf functionality towards decreasing per tracepoint overhead instead, without hurting kernel functionality and maintainability.
Thanks,
Ingo
=================>CONFIG_LOCALVERSION_AUTO=yCONFIG_IRQ_TIME_ACCOUNTING=yCONFIG_IKCONFIG=yCONFIG_IKCONFIG_PROC=yCONFIG_SYSFS_DEPRECATED=yCONFIG_EXPERT=yCONFIG_KALLSYMS_ALL=yCONFIG_COMPAT_BRK=yCONFIG_OPROFILE=yCONFIG_OPROFILE_EVENT_MULTIPLEX=yCONFIG_JUMP_LABEL=yCONFIG_KPROBES_ON_FTRACE=yCONFIG_USER_RETURN_NOTIFIER=yCONFIG_MODULE_FORCE_LOAD=yCONFIG_PREEMPT_NOTIFIERS=yCONFIG_X86_MCE_INJECT=yCONFIG_NUMA_EMU=yCONFIG_MEMORY_ISOLATION=yCONFIG_MMU_NOTIFIER=yCONFIG_MEMORY_FAILURE=yCONFIG_HWPOISON_INJECT=yCONFIG_TRANSPARENT_HUGEPAGE=yCONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=yCONFIG_EFI_STUB=yCONFIG_HZ_250=yCONFIG_COMPAT_VDSO=yCONFIG_PM_RUNTIME=yCONFIG_ACPI_PROCFS_POWER=yCONFIG_CPU_FREQ_STAT=yCONFIG_CPU_FREQ_STAT_DETAILS=yCONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=yCONFIG_CPU_FREQ_GOV_POWERSAVE=yCONFIG_CPU_FREQ_GOV_CONSERVATIVE=yCONFIG_X86_POWERNOW_K8=yCONFIG_INTEL_IDLE=yCONFIG_PCIEAER_INJECT=yCONFIG_PCIE_PME=yCONFIG_PCI_IOAPIC=yCONFIG_IA32_AOUT=yCONFIG_COMPAT_NETLINK_MESSAGES=yCONFIG_INET_DIAG=yCONFIG_INET_TCP_DIAG=yCONFIG_INET_UDP_DIAG=yCONFIG_BPF_JIT=yCONFIG_WEXT_CORE=yCONFIG_WEXT_PROC=yCONFIG_CFG80211_WEXT=yCONFIG_DEVTMPFS=yCONFIG_DEVTMPFS_MOUNT=yCONFIG_BLK_DEV_CRYPTOLOOP=yCONFIG_BLK_DEV_RAM=yCONFIG_SCSI_NETLINK=yCONFIG_SCSI_SCAN_ASYNC=yCONFIG_SCSI_FC_ATTRS=yCONFIG_SCSI_LOWLEVEL=yCONFIG_MEGARAID_SAS=yCONFIG_SATA_NV=yCONFIG_SATA_SIL=yCONFIG_SATA_SVW=yCONFIG_PATA_ATIIXP=yCONFIG_PATA_PDC2027X=yCONFIG_PATA_MPIIX=yCONFIG_PATA_ACPI=yCONFIG_ATA_GENERIC=yCONFIG_DM_CRYPT=yCONFIG_FIREWIRE=yCONFIG_FIREWIRE_OHCI=yCONFIG_TUN=yCONFIG_MDIO=yCONFIG_VORTEX=yCONFIG_B44=yCONFIG_B44_PCI_AUTOSELECT=yCONFIG_B44_PCICORE_AUTOSELECT=yCONFIG_B44_PCI=yCONFIG_BNX2=yCONFIG_TULIP=yCONFIG_E1000E=yCONFIG_IGB=yCONFIG_IGB_HWMON=yCONFIG_IXGB=yCONFIG_IXGBE=yCONFIG_IXGBE_HWMON=yCONFIG_R8169=yCONFIG_BROADCOM_PHY=yCONFIG_USB_USBNET=yCONFIG_USB_NET_AX8817X=yCONFIG_USB_NET_AX88179_178A=yCONFIG_USB_NET_CDC_NCM=yCONFIG_USB_NET_MCS7830=yCONFIG_USB_ALI_M5632=yCONFIG_USB_AN2720=yCONFIG_USB_BELKIN=yCONFIG_USB_ARMLINUX=yCONFIG_USB_EPSON2888=yCONFIG_INPUT_MOUSEDEV_PSAUX=yCONFIG_LEGACY_PTYS=yCONFIG_SERIAL_KGDB_NMI=yCONFIG_CONSOLE_POLL=yCONFIG_HW_RANDOM_INTEL=yCONFIG_HW_RANDOM_AMD=yCONFIG_RAW_DRIVER=yCONFIG_HPET_MMAP=yCONFIG_SSB=yCONFIG_SSB_SPROM=yCONFIG_SSB_PCIHOST_POSSIBLE=yCONFIG_SSB_PCIHOST=yCONFIG_SSB_DRIVER_PCICORE_POSSIBLE=yCONFIG_SSB_DRIVER_PCICORE=yCONFIG_DRM_TTM=yCONFIG_DRM_RADEON=yCONFIG_FB_DDC=yCONFIG_FB_BACKLIGHT=yCONFIG_FB_RADEON=yCONFIG_FB_RADEON_I2C=yCONFIG_FB_RADEON_BACKLIGHT=yCONFIG_SOUND_PRIME=yCONFIG_HID_BATTERY_STRENGTH=yCONFIG_HID_DRAGONRISE=yCONFIG_HID_KYE=yCONFIG_HID_TWINHAN=yCONFIG_HID_ORTEK=yCONFIG_HID_GREENASIA=yCONFIG_HID_SMARTJOYPLUS=yCONFIG_HID_THRUSTMASTER=yCONFIG_HID_ZEROPLUS=yCONFIG_USB_STORAGE_REALTEK=yCONFIG_REALTEK_AUTOPM=yCONFIG_USB_STORAGE_DATAFAB=yCONFIG_USB_STORAGE_FREECOM=yCONFIG_USB_STORAGE_ISD200=yCONFIG_USB_STORAGE_USBAT=yCONFIG_USB_STORAGE_SDDR09=yCONFIG_USB_STORAGE_SDDR55=yCONFIG_USB_STORAGE_JUMPSHOT=yCONFIG_USB_STORAGE_ALAUDA=yCONFIG_USB_STORAGE_ONETOUCH=yCONFIG_USB_STORAGE_KARMA=yCONFIG_USB_STORAGE_CYPRESS_ATACB=yCONFIG_USB_STORAGE_ENE_UB6250=yCONFIG_EFI_VARS_PSTORE=yCONFIG_REISERFS_FS=yCONFIG_REISERFS_FS_XATTR=yCONFIG_REISERFS_FS_POSIX_ACL=yCONFIG_EXPORTFS=yCONFIG_UDF_FS=yCONFIG_UDF_NLS=yCONFIG_PSTORE=yCONFIG_PSTORE_CONSOLE=yCONFIG_PSTORE_FTRACE=yCONFIG_PSTORE_RAM=yCONFIG_NFSD=yCONFIG_NFSD_V3=yCONFIG_CIFS=yCONFIG_CIFS_DEBUG=yCONFIG_NLS_ISO8859_15=yCONFIG_DYNAMIC_DEBUG=yCONFIG_DEBUG_INFO=yCONFIG_DEBUG_INFO_REDUCED=yCONFIG_ENABLE_WARN_DEPRECATED=yCONFIG_READABLE_ASM=yCONFIG_UNUSED_SYMBOLS=yCONFIG_DETECT_HUNG_TASK=yCONFIG_SCHED_DEBUG=yCONFIG_LATENCYTOP=yCONFIG_TRACER_MAX_TRACE=yCONFIG_RING_BUFFER_ALLOW_SWAP=yCONFIG_FUNCTION_TRACER=yCONFIG_FUNCTION_GRAPH_TRACER=yCONFIG_SCHED_TRACER=yCONFIG_FTRACE_SYSCALLS=yCONFIG_TRACER_SNAPSHOT=yCONFIG_DYNAMIC_FTRACE=yCONFIG_DYNAMIC_FTRACE_WITH_REGS=yCONFIG_FTRACE_MCOUNT_RECORD=yCONFIG_FIREWIRE_OHCI_REMOTE_DMA=yCONFIG_KGDB=yCONFIG_KGDB_SERIAL_CONSOLE=yCONFIG_KGDB_KDB=yCONFIG_KDB_KEYBOARD=yCONFIG_X86_PTDUMP=yCONFIG_IO_DELAY_0XED=yCONFIG_DEFAULT_SECURITY_DAC=yCONFIG_CRYPTO_RNG=yCONFIG_CRYPTO_GF128MUL=yCONFIG_CRYPTO_NULL=yCONFIG_CRYPTO_CRYPTD=yCONFIG_CRYPTO_CCM=yCONFIG_CRYPTO_GCM=yCONFIG_CRYPTO_SEQIV=yCONFIG_CRYPTO_CTR=yCONFIG_CRYPTO_CTS=yCONFIG_CRYPTO_ECB=yCONFIG_CRYPTO_LRW=yCONFIG_CRYPTO_PCBC=yCONFIG_CRYPTO_CMAC=yCONFIG_CRYPTO_CRCT10DIF=yCONFIG_CRYPTO_GHASH=yCONFIG_CRYPTO_MD4=yCONFIG_CRYPTO_SHA256=yCONFIG_CRYPTO_SHA512=yCONFIG_CRYPTO_AES_X86_64=yCONFIG_HAVE_KVM_IRQCHIP=yCONFIG_HAVE_KVM_IRQ_ROUTING=yCONFIG_HAVE_KVM_EVENTFD=yCONFIG_KVM_APIC_ARCHITECTURE=yCONFIG_KVM_MMIO=yCONFIG_KVM_ASYNC_PF=yCONFIG_HAVE_KVM_MSI=yCONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=yCONFIG_KVM=yCONFIG_KVM_INTEL=yCONFIG_CRC_T10DIF=yCONFIG_CRC_ITU_T=yCONFIG_LIBCRC32C=yCONFIG_ZLIB_DEFLATE=yCONFIG_XZ_DEC_POWERPC=yCONFIG_XZ_DEC_IA64=yCONFIG_XZ_DEC_ARM=yCONFIG_XZ_DEC_ARMTHUMB=yCONFIG_XZ_DEC_SPARC=yCONFIG_REED_SOLOMON=yCONFIG_REED_SOLOMON_ENC8=yCONFIG_REED_SOLOMON_DEC8=y
Steven Rostedt
maintainerRe: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 6 lines · Ingo Molnar
Secondly and more importantly, visualized with relative sizes, in a feature matrix, makes it clearer what's going on with vmlinux .text:
perf-OFF perf-ON
Quoted 8 lines
ftrace-OFF 0 +151k
ftrace-ON +897k +1142k
So basically ftrace is causing a big chunk of the instrumentation size increase. With tons of tracers and lots of kernel subsystems built into your .config that's a lot of nice instrumentation functionality and it's thus also a natural end result IMO.
I'm curious what you turned on for between the "ftrace-OFF" and "ftrace-ON"?
Technically, ftrace is just the infrastructure for the /debug/tracing directory and the function tracer. And there's lots of options to turn on or off:
CONFIG_TRACER_MAX_TRACE=yCONFIG_RING_BUFFER_ALLOW_SWAP=yCONFIG_FUNCTION_TRACER=yCONFIG_FUNCTION_GRAPH_TRACER=yCONFIG_SCHED_TRACER=yCONFIG_FTRACE_SYSCALLS=yCONFIG_TRACER_SNAPSHOT=yCONFIG_DYNAMIC_FTRACE=yCONFIG_DYNAMIC_FTRACE_WITH_REGS=yCONFIG_FTRACE_MCOUNT_RECORD=y
The one thing that you didn't post was CONFIG_EVENT_TRACING. This is where a lot of bloat can come from, as this enables the infrastructure for tracepoints. This is also needed by perf to trace most sw events.
The trace event infrastructure that both perf and ftrace uses (as well as other tracers and tools) is well known to cause bloat in the kernel. There's patches to help make it more bearable, but there's more work to be done.
Currently, ftrace selects events, but that was only because you suggested to do so as events are so valuable in tracing.
-- Steve
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 9 lines · Steven Rostedt
Quoted 8 lines · Ingo Molnar
Secondly and more importantly, visualized with relative sizes, in a feature matrix, makes it clearer what's going on with vmlinux .text:
perf-OFF perf-ON
ftrace-OFF 0 +151k
Quoted 8 lines
Quoted 6 lines
ftrace-ON +897k +1142kSo basically ftrace is causing a big chunk of the instrumentation size increase. With tons of tracers and lots of kernel subsystems built into your .config that's a lot of nice instrumentation functionality and it's thus also a natural end result IMO.
I'm curious what you turned on for between the "ftrace-OFF" and "ftrace-ON"?
ON: all the tracing bits in Andi's original config - which had most tracing options enabled AFAICS.
OFF: all of it turned off.
I don't think there's anything inherently wrong with 3000+ tracepoints built into the kernel using up a fair amount of cold-path space. We should try to compress it all, but it's a hell of a lot real functionality.
Quoted 3 lines
The one thing that you didn't post was
CONFIG_EVENT_TRACING. This is where a lot of bloat can come from, as this enables the infrastructure for tracepoints. This is also needed by perf to trace most sw events.
Correct.
EVENT_TRACING was on - Andi did not post his .config publicly, but you can get something fairly close to his config by doing this:
make defconfig
cat config-options.txt >> .config
make oldconfig
where 'config-options.txt' is the short list of options I appended to my mail.
Quoted 4 lines
The trace event infrastructure that both perf and ftrace uses (as well as other tracers and tools) is well known to cause bloat in the kernel. There's patches to help make it more bearable, but there's more work to be done.
It's 3000+ very nice tracepoints - which is a huge multiplier, so we should not expect any miracles - it's a whole lot of good functionality. Subsystems can decide whether they want to expose their tracepoints or not.
Thanks,
Ingo
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Ingo MolnarQuoted 2 lines · Ingo Molnar
The base cost of perf is +151k - not small but a far cry from your claimed +700k ...
Things might get that bad if we enable full event lists in the kernel for all of x86, as Power is starting to do.
The patch to add all Power7 events cfe0d8ba14a1d98245b371e486c68f37eba1ca52 increased kernel size by like 50k. Imagine 10 different x86 event tables times 50k each and you're talking a big chunk of memory.
Vince
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Ingo MolnarQuoted 3 lines · Ingo Molnar
You might want to concentrate your efforts from fighting perf functionality towards decreasing per tracepoint overhead instead, without hurting kernel functionality and maintainability.
Making it easier to disable perf entirely would be desirable for one use case. I can't do a trinity run for more than a few hours for the last few months without hitting perf/ftrace bugs that no-one seems to be able to get their heads around.
It would be useful if I could in the meantime find bugs in other parts of the kernel by disabling all the affected code.
Dave
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 10 lines · Dave Jones
Quoted 3 lines · Ingo Molnar
You might want to concentrate your efforts from fighting perf functionality towards decreasing per tracepoint overhead instead, without hurting kernel functionality and maintainability.
Making it easier to disable perf entirely would be desirable for one use case. I can't do a trinity run for more than a few hours for the last few months without hitting perf/ftrace bugs that no-one seems to be able to get their heads around.
Looks like trinity has an exclude syscall option. Seems like that option can be used to avoid perf_event_open (haven't tried though).
David
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 7 lines · David Ahern
Quoted 6 lines · Dave Jones
Quoted 3 lines · Ingo Molnar
You might want to concentrate your efforts from fighting perf functionality towards decreasing per tracepoint overhead instead, without hurting kernel functionality and maintainability.
Quoted 7 lines
Quoted 4 lines
Making it easier to disable perf entirely would be desirable for one use case. I can't do a trinity run for more than a few hours for the last few months without hitting perf/ftrace bugs that no-one seems to be able to get their heads around.
Looks like trinity has an exclude syscall option. Seems like that option can be used to avoid
perf_event_open(haven't tried though).
You'd think that, but for whatever reason, ftrace/perf oopses still happen.
Dave
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 13 lines · Dave Jones
Quoted 12 lines · David Ahern
Quoted 10 lines · Dave Jones
Quoted 3 lines · Ingo Molnar
You might want to concentrate your efforts from fighting perf functionality towards decreasing per tracepoint overhead instead, without hurting kernel functionality and maintainability.
Making it easier to disable perf entirely would be desirable for one use case. I can't do a trinity run for more than a few hours for the last few months without hitting perf/ftrace bugs that no-one seems to be able to get their heads around.
Quoted 4 lines
Quoted 2 lines
Looks like trinity has an exclude syscall option. Seems like that option can be used to avoid
perf_event_open(haven't tried though).You'd think that, but for whatever reason, ftrace/perf oopses still happen.
Peter is working on it - but it's slow. Could you try to disable sys_perf_open, ptrace and the NMI watchdog? No perf functionality should be used in that case. If you disable CONFIG_FTRACE then no ftrace functionality should be used.
Thanks,
Ingo
Steven Rostedt
maintainerRe: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
Quoted 6 lines · Ingo Molnar
Peter is working on it - but it's slow. Could you try to disable
sys_perf_open, ptrace and the NMI watchdog? No perf functionality should be used in that case. If you disableCONFIG_FTRACEthen no ftrace functionality should be used.
Dave,
The ftrace oops you've been seeing is from the function tracer, you don't need to disable all of ftrace, just CONFIG_FUNCTION_TRACER (and anything that selects it: CONFIG_STACK_TRACER).
-- Steve
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Dave JonesQuoted 1 line
You'd think that, but for whatever reason, ftrace/perf oopses still happen.
Hiding bugs seems like a poor use of the CONFIG option. It would be better to figure out a way to catch them earlier. Perhaps trinity needs to run more often? any chance of a fengguang style nightly service for mainline?
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Ingo MolnarQuoted 3 lines
So I test-built a config close to your config with both tracing and perf on and off (note, I had OPROFILE and KVM in a module), and got the following kernel sizes:
Yes I mistakenly included KVM (I think that was the difference) Without KVM it's ~272k text, 96k BSS data delta.
Still big, but not quite as bad as I made it out to be.
Thanks for catching.
-Andi
Re: [PATCH 6/6] x86: Allow disabling HW_BREAKPOINTS and PERF_EVENTS
In reply to Ingo MolnarSome more comments.
Quoted 1 line
- your patches might break apps/ABI
Can you please explain that a bit more. We have a lot of CONFIG options that disable syscalls, /sys, lots of stuff. Whoever uses them needs to know what they are doing. I thought it was pretty
much consensus that Linux is supposed to be a very configurable OS, which people can taylor from small embedded to large kitchen sink included using CONFIG_*.
Are you saying that Linux should not be configurable small to big? (I would find that hard to believe). If that's really your standpoint I would like to see some confirmation on this, as it would seem a big departure from traditional practice.
Or is the concern that you want it default y or EXPERT, so what the defaults are? That sounds reasonable.
Or should it be more modular like Peter pointed out (that would seem like a good solution for generic distros, but not so good for deeply embedded like running on Quark)
BTW afaik pretty much every other architecture still allows to disable it, just x86 has this dependency loop problem.
Quoted 3 lines
- your patch-set unnecessarily complicates things, making the kernel less maintainable
I actually simplified some things, like unnecessary dependencies between perf and profile.
These should be applied in any case as they are independent. I can repost them.
Given some of the ifdefs/configs were not nice, perhaps there's a better solution for this from Frederic.
-Andi