lkml.org 
[lkml]   [2011]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH] sched: try to fix mm leak when freeing sched groups
From
On Thu, Apr 21, 2011 at 10:20 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Thu, 2011-04-21 at 21:46 +0800, Hillf Danton wrote:
>>
>> It is linux-2.6.39-rc1.tar.bz2 downloaded at kernel.org, and
>>           >> --- a/kernel/sched.c  2011-03-30 03:09:48.000000000 +0800
>> is the time stamp, right?
>
> Dunno, but 39-rc1 is like ancient, please send patches against the tip
> git tree:
>
>  git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git
>

Hi Peter

I tried again, and please review once more.

thanks

Hillf
---

--- linux-2.6.39-rc5/kernel/sched.c 2011-04-27 11:48:50.000000000 +0800
+++ sched.c 2011-05-02 10:38:02.000000000 +0800
@@ -7120,21 +7120,18 @@ 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))
continue;

- 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;
+ if (sg != NULL)
+ 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2011-05-02 04:41    [W:0.299 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site