mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Xunlei Pang <xlpang@126.com>
Cc: linux-kernel@vger.kernel.org,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Xunlei Pang <pang.xunlei@zte.com.cn>
Subject: Re: [PATCH] workqueue: Free useless memory when disabling NUMA in wq_numa_init()
Date: Thu, 17 Sep 2015 11:29:51 -0400	[thread overview]
Message-ID: <20150917152951.GE7205@mtj.duckdns.org> (raw)
In-Reply-To: <1442457835-24238-1-git-send-email-xlpang@126.com>

Hello,

On Thu, Sep 17, 2015 at 10:43:55AM +0800, Xunlei Pang wrote:
> 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);

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

      reply	other threads:[~2015-09-17 15:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17  2:43 Xunlei Pang
2015-09-17 15:29 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150917152951.GE7205@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pang.xunlei@zte.com.cn \
    --cc=xlpang@126.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®