mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <dhillf@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
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 21:46:57 +0800	[thread overview]
Message-ID: <BANLkTinYu00M9No_Pqxp+gpEZAmPJPDt1g@mail.gmail.com> (raw)
In-Reply-To: <1303393450.2035.142.camel@laptop>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 2381 bytes --]

On Thu, Apr 21, 2011 at 9:44 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> 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?
>
Hi Peter

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?

thanks
          Hillf

>> 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;
>
>
>
>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2011-04-21 13:46 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
2011-04-21 13:46   ` Hillf Danton [this message]
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=BANLkTinYu00M9No_Pqxp+gpEZAmPJPDt1g@mail.gmail.com \
    --to=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    /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®