public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: kvm@vger.kernel.org,
	Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
	David Herrmann <dh.herrmann@gmail.com>,
	Stephane Eranian <eranian@google.com>,
	linux-kernel@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Paul Mackerras <paulus@samba.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andi Kleen <ak@linux.intel.com>,
	x86@kernel.org, Ingo Molnar <mingo@redhat.com>,
	oprofile-list@lists.sf.net, Mel Gorman <mgorman@suse.de>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Borislav Petkov <bp@suse.de>, Dave Young <dyoung@redhat.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Gleb Natapov <gleb@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>, Bin Gao <bin.gao@intel.com>,
	Matt Fleming <matt.fleming@intel.com>,
	Jacob Shin <jacob.shin@amd.com>, Oleg Nesterov <oleg@redhat.com>,
	Torsten Kaiser <just.for.lkml@googlemail.com
Subject: Re: [PATCH v2 6/7] x86: Allow disabling HW_BREAKPOINTS, PERF_EVENTS, INSTRUCTION_DECODER, IRQ_WORK
Date: Mon, 10 Mar 2014 17:14:11 +0100	[thread overview]
Message-ID: <20140310161408.GF14639@localhost.localdomain> (raw)
In-Reply-To: <5a5942a0cdb0914ecd81d2880190c19abb228511.1394418994.git.josh@joshtriplett.org>

On Sun, Mar 09, 2014 at 08:12:53PM -0700, Josh Triplett wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> 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)  This then allows disabling IRQ_WORK
> and INSTRUCTION_DECODER.
> 
> This change reduces the size of allnoconfig by 161k, a full 7.6%
> reduction:
>    text	   data	    bss	    dec	    hex	filename
>  788816	 131952	1214432	2135200	 2094a0	vmlinux-allnoconfig-with-perf
>  666361	  93020	1214368	1973749	 1e1df5	vmlinux-allnoconfig-no-perf
> 
> bloat-o-meter summary:
> add/remove: 1/1040 grow/shrink: 1/25 up/down: 82/-152214 (-152132)

My review hasn't changed much since last time (https://lkml.org/lkml/2013/10/4/483),
so I'm mostly copy pasting it here so that we can discuss if you want:

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:

> 
> Suggested-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> [josh: Rebased; HW_BREAKPOINTS marked as EXPERT; commit message updated
>        with new statistics.]
> Signed-off-by: Josh Triplett <josh@joshtriplett.org>
> ---
>  arch/x86/Kconfig         | 12 +++++++++---
>  arch/x86/kernel/Makefile |  3 ++-
>  arch/x86/kvm/Kconfig     |  1 +
>  3 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 0af5250..12e3386 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -70,9 +70,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
> @@ -587,6 +584,15 @@ config SCHED_OMIT_FRAME_POINTER
>  
>  	  If in doubt, say "Y".
>  
> +config HW_BREAKPOINTS
> +	bool "Enable hardware breakpoints support" if EXPERT
> +	default y
> +	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.
> +

HW_BREAKPOINTS must depend on HAVE_HW_BREAKPOINT, not the other way round.
HAVE_* Kconfig symbols must only express constant backend support, not a variable user choice...

ie, that's what I did in this patchset
https://lkml.org/lkml/2011/7/14/163

Thanks.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech

  parent reply	other threads:[~2014-03-10 16:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1394418994.git.josh@joshtriplett.org>
2014-03-10  4:19 ` [PATCH v2 0/7] Allow disabling HW_BREAKPOINTS, PERF_EVENTS, INSTRUCTION_DECODER, IRQ_WORK, ANON_INODES Andi Kleen
2014-03-10  7:43 ` Ingo Molnar
2014-03-10  8:42   ` Josh Triplett
2014-03-11 10:29     ` Ingo Molnar
2014-03-10 14:50   ` Oleg Nesterov
2014-03-11 10:30     ` Ingo Molnar
     [not found] ` <32f5e0a3b421b615be3af24b0319afff1a385403.1394418994.git.josh@joshtriplett.org>
2014-03-10 14:21   ` [PATCH v2 4/7] trace: Make UPROBES depend on PERF_EVENTS Oleg Nesterov
2014-03-10 15:03     ` Josh Triplett
     [not found] ` <2741f8cbe6346ef051f7f7b1c39f9a026942b763.1394418994.git.josh@joshtriplett.org>
2014-03-10 14:35   ` [PATCH v2 3/7] x86, ptrace: Ifdef HW_BREAKPOINTS code in ptrace Oleg Nesterov
2014-03-10 14:42     ` Oleg Nesterov
2014-03-10 15:15       ` Josh Triplett
2014-03-10 17:41         ` Andi Kleen
2014-03-10 17:44           ` Andi Kleen
     [not found] ` <5a5942a0cdb0914ecd81d2880190c19abb228511.1394418994.git.josh@joshtriplett.org>
2014-03-10 16:14   ` Frederic Weisbecker [this message]
2014-03-10 17:20     ` [PATCH v2 6/7] x86: Allow disabling HW_BREAKPOINTS, PERF_EVENTS, INSTRUCTION_DECODER, IRQ_WORK Josh Triplett
2014-03-10 20:50     ` Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140310161408.GF14639@localhost.localdomain \
    --to=fweisbec@gmail.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=ak@linux.intel.com \
    --cc=bin.gao@intel.com \
    --cc=bp@suse.de \
    --cc=dh.herrmann@gmail.com \
    --cc=dyoung@redhat.com \
    --cc=eranian@google.com \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jacob.shin@amd.com \
    --cc=josh@joshtriplett.org \
    --cc=just.for.lkml@googlemail.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=oprofile-list@lists.sf.net \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox