mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Hillf Danton <dhillf@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] sched: try to fix mm leak when freeing sched groups
Date: Thu, 21 Apr 2011 15:44:10 +0200	[thread overview]
Message-ID: <1303393450.2035.142.camel@laptop> (raw)
In-Reply-To: <BANLkTin_m2Ygnr8csKo6fJZ4sB6YYvYDGw@mail.gmail.com>

On Thu, 2011-04-21 at 21:37 +0800, Hillf Danton wrote:
> When freeing sched groups, there is a sg (== sched_group_nodes[i]) not
> got freed.
> The relevant code is reshuffled to be clearer, and correct.

The code doesn't even appear to exist, what kernel are you patching?

> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> ---
> 
> --- a/kernel/sched.c	2011-03-30 03:09:48.000000000 +0800
> +++ b/kernel/sched.c	2011-04-21 21:09:00.000000000 +0800
> @@ -7106,7 +7106,7 @@ static void free_sched_groups(const stru
>  			continue;
> 
>  		for (i = 0; i < nr_node_ids; i++) {
> -			struct sched_group *oldsg, *sg = sched_group_nodes[i];
> +			struct sched_group *sg = sched_group_nodes[i];
> 
>  			cpumask_and(nodemask, cpumask_of_node(i), cpu_map);
>  			if (cpumask_empty(nodemask))
> @@ -7114,13 +7114,11 @@ static void free_sched_groups(const stru
> 
>  			if (sg == NULL)
>  				continue;
> -			sg = sg->next;
> -next_sg:
> -			oldsg = sg;
> -			sg = sg->next;
> -			kfree(oldsg);
> -			if (oldsg != sched_group_nodes[i])
> -				goto next_sg;
> +			do {
> +				struct sched_group *next = sg->next;
> +				kfree(sg);
> +				sg = next;
> +			} while (sg != sched_group_nodes[i]);
>  		}
>  		kfree(sched_group_nodes);
>  		sched_group_nodes_bycpu[cpu] = NULL;




  reply	other threads:[~2011-04-21 13:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 13:37 Hillf Danton
2011-04-21 13:44 ` Peter Zijlstra [this message]
2011-04-21 13:46   ` Hillf Danton
2011-04-21 14:20     ` Peter Zijlstra
2011-04-21 14:22       ` Hillf Danton
2011-05-02  2:38       ` Hillf Danton

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=1303393450.2035.142.camel@laptop \
    --to=peterz@infradead.org \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®