lkml.org 
[lkml]   [2013]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] kernel/workqueue.c: better to free related resources when failure occurs in wq_numa_init()

When NUMA node mapping not available for one cpu, need disabling NUMA
support and proceed.

Also better to release unused resources (the original code can not
cause issue, only waste some memory).


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
kernel/workqueue.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 1ae6028..a763079 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -4911,6 +4911,9 @@ static void __init wq_numa_init(void)
if (WARN_ON(node == NUMA_NO_NODE)) {
pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu);
/* happens iff arch is bonkers, let's just proceed */
+ for_each_node(node)
+ free_cpumask_var(tbl[node]);
+ kfree(tbl);
return;
}
cpumask_set_cpu(cpu, tbl[node]);
--
1.7.11.7

\
 
 \ /
  Last update: 2013-05-14 15:01    [W:0.049 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site