mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	"K. Prasad" <prasad@linux.vnet.ibm.com>,
	Maneesh Soni <maneesh@in.ibm.com>
Subject: [GIT PULL] hw_breakpoint fix
Date: Thu, 28 Jan 2010 15:32:52 +0100	[thread overview]
Message-ID: <1264689172-9077-1-git-send-regression-fweisbec@gmail.com> (raw)

Ingo,

Please pull the perf/urgent branch that can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	perf/urgent

Thanks,
	Frederic
---

Mahesh Salgaonkar (1):
      hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.


 kernel/hw_breakpoint.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

---
commit b23ff0e9330e4b11e18af984d50573598e10e7f9
Author: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Date:   Thu Jan 21 18:25:16 2010 +0530

    hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.
    
    On a given architecture, when hardware breakpoint registration fails
    due to un-supported access type (read/write/execute), we lose the bp
    slot since register_perf_hw_breakpoint() does not release the bp slot
    on failure.
    Hence, any subsequent hardware breakpoint registration starts failing
    with 'no space left on device' error.
    
    This patch introduces error handling in register_perf_hw_breakpoint()
    function and releases bp slot on error.
    
    Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
    Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
    Cc: K. Prasad <prasad@linux.vnet.ibm.com>
    Cc: Maneesh Soni <maneesh@in.ibm.com>
    LKML-Reference: <20100121125516.GA32521@in.ibm.com>
    Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>

diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c
index 50dbd59..c030ae6 100644
--- a/kernel/hw_breakpoint.c
+++ b/kernel/hw_breakpoint.c
@@ -296,6 +296,10 @@ int register_perf_hw_breakpoint(struct perf_event *bp)
 	if (!bp->attr.disabled || !bp->overflow_handler)
 		ret = arch_validate_hwbkpt_settings(bp, bp->ctx->task);
 
+	/* if arch_validate_hwbkpt_settings() fails then release bp slot */
+	if (ret)
+		release_bp_slot(bp);
+
 	return ret;
 }
 

             reply	other threads:[~2010-01-28 14:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 14:32 Frederic Weisbecker [this message]
2010-01-29  7:13 ` Ingo Molnar

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=1264689172-9077-1-git-send-regression-fweisbec@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=ananth@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=maneesh@in.ibm.com \
    --cc=mingo@elte.hu \
    --cc=prasad@linux.vnet.ibm.com \
    /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

Powered by JetHome