lkml.org 
[lkml]   [2015]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] workqueue: Free useless memory when disabling NUMA in wq_numa_init()
Date
From: Xunlei Pang <pang.xunlei@zte.com.cn>

wq_update_unbound_numa_attrs_buf and tbl will never be used
in case of invalid NUMA node mapping, so just free them.

Signed-off-by: Xunlei Pang <pang.xunlei@zte.com.cn>
---
kernel/workqueue.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ca71582..22d7747 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5197,6 +5197,13 @@ static void __init wq_numa_init(void)
node = cpu_to_node(cpu);
if (WARN_ON(node == NUMA_NO_NODE)) {
pr_warn("workqueue: NUMA node mapping not available for cpu%d, disabling NUMA support\n", cpu);
+
+ for_each_node(node)
+ free_cpumask_var(tbl[node]);
+ kfree(tbl);
+
+ free_workqueue_attrs(wq_update_unbound_numa_attrs_buf);
+ wq_update_unbound_numa_attrs_buf = NULL;
/* happens iff arch is bonkers, let's just proceed */
return;
}
--
1.9.1



\
 
 \ /
  Last update: 2015-09-17 05:01    [W:0.406 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site