[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-b23ff0e9330e4b11e18af984d50573598e10e7f9@git.kernel.org>
Date: Fri, 29 Jan 2010 09:24:38 GMT
From: tip-bot for Mahesh Salgaonkar <mahesh@...ux.vnet.ibm.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, maneesh@...ibm.com, hpa@...or.com,
mingo@...hat.com, mahesh@...ux.vnet.ibm.com, ananth@...ibm.com,
fweisbec@...il.com, tglx@...utronix.de, prasad@...ux.vnet.ibm.com
Subject: [tip:perf/core] hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.
Commit-ID: b23ff0e9330e4b11e18af984d50573598e10e7f9
Gitweb: http://git.kernel.org/tip/b23ff0e9330e4b11e18af984d50573598e10e7f9
Author: Mahesh Salgaonkar <mahesh@...ux.vnet.ibm.com>
AuthorDate: Thu, 21 Jan 2010 18:25:16 +0530
Committer: Frederic Weisbecker <fweisbec@...il.com>
CommitDate: Thu, 28 Jan 2010 14:15:51 +0100
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@...ux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@...ibm.com>
Cc: K. Prasad <prasad@...ux.vnet.ibm.com>
Cc: Maneesh Soni <maneesh@...ibm.com>
LKML-Reference: <20100121125516.GA32521@...ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
---
kernel/hw_breakpoint.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists