From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752072AbbIQP34 (ORCPT ); Thu, 17 Sep 2015 11:29:56 -0400 Received: from mail-yk0-f182.google.com ([209.85.160.182]:35658 "EHLO mail-yk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbbIQP3y (ORCPT ); Thu, 17 Sep 2015 11:29:54 -0400 Date: Thu, 17 Sep 2015 11:29:51 -0400 From: Tejun Heo To: Xunlei Pang Cc: linux-kernel@vger.kernel.org, Lai Jiangshan , Xunlei Pang Subject: Re: [PATCH] workqueue: Free useless memory when disabling NUMA in wq_numa_init() Message-ID: <20150917152951.GE7205@mtj.duckdns.org> References: <1442457835-24238-1-git-send-email-xlpang@126.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442457835-24238-1-git-send-email-xlpang@126.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Sep 17, 2015 at 10:43:55AM +0800, Xunlei Pang wrote: > From: Xunlei Pang > > 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 > --- > 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); So, this is "either bios or arch code buggy but let's keep limping on rather than crashing" path. It doesn't matter whether there's something lingering behind. We wanna keep it as simple as possible. Thanks. -- tejun