Allen Martin | 685e0f8 | 2016-07-26 19:34:29 -0700 | [diff] [blame^] | 1 | From 3e1a0dabde58e814d74a2d495cd189e16fecfd41 Mon Sep 17 00:00:00 2001 |
| 2 | From: Thomas Gleixner <tglx@linutronix.de> |
| 3 | Date: Sun, 17 Jul 2011 21:41:35 +0200 |
| 4 | Subject: [PATCH 226/317] debugobjects: Make RT aware |
| 5 | X-NVConfidentiality: public |
| 6 | |
| 7 | Avoid filling the pool / allocating memory with irqs off(). |
| 8 | |
| 9 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| 10 | Signed-off-by: Allen Martin <amartin@nvidia.com> |
| 11 | --- |
| 12 | lib/debugobjects.c | 5 ++++- |
| 13 | 1 file changed, 4 insertions(+), 1 deletion(-) |
| 14 | |
| 15 | diff --git a/lib/debugobjects.c b/lib/debugobjects.c |
| 16 | index 547f7f923dbc..8fcdbc2fc6d0 100644 |
| 17 | --- a/lib/debugobjects.c |
| 18 | +++ b/lib/debugobjects.c |
| 19 | @@ -309,7 +309,10 @@ __debug_object_init(void *addr, struct debug_obj_descr *descr, int onstack) |
| 20 | struct debug_obj *obj; |
| 21 | unsigned long flags; |
| 22 | |
| 23 | - fill_pool(); |
| 24 | +#ifdef CONFIG_PREEMPT_RT_FULL |
| 25 | + if (preempt_count() == 0 && !irqs_disabled()) |
| 26 | +#endif |
| 27 | + fill_pool(); |
| 28 | |
| 29 | db = get_bucket((unsigned long) addr); |
| 30 | |
| 31 | -- |
| 32 | 2.9.3 |
| 33 | |