Re: Patch "percpu: fix a memory leak in pcpu_extend_area_map()" hasbeen added to the 2.6.35-stable tree

From: Huang Shijie
Date: Thu Sep 16 2010 - 22:43:14 EST


hi :

I think this maybe caused by the kfree/vfree.
I do not have any AMD machine. Could you add some log to debug it
? such as in pcpu_extend_area_map():

================================
printk(KERN_INFO "[ %s ] line : %d\n", __func__, __LINE__);
pcpu_mem_free(old, old_size);
printk(KERN_INFO "[ %s ] line : %d\n", __func__, __LINE__);
pcpu_mem_free(new, new_size);
printk(KERN_INFO "[ %s ] line : %d\n", __func__, __LINE__);

================================
The system will print the log before it hung.

Best Regards.
Huang Shijie


2010/9/17 Stefan Lippers-Hollmann <s.L-H@xxxxxx>:
> Hi
>
> On Thursday 16 September 2010, gregkh@xxxxxxx wrote:
>> This is a note to let you know that I've just added the patch titled
>> Â Â percpu: fix a memory leak in pcpu_extend_area_map()
>> to the 2.6.35-stable tree which can be found at:
>> Â Â http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
> [...]
>> From a002d148426f40bc2b7dc066982eb177cdebeaaa Mon Sep 17 00:00:00 2001
>> From: Huang Shijie <shijie8@xxxxxxxxx>
>> Date: Sun, 8 Aug 2010 14:39:07 +0200
>> Subject: percpu: fix a memory leak in pcpu_extend_area_map()
>>
>> From: Huang Shijie <shijie8@xxxxxxxxx>
>>
>> commit a002d148426f40bc2b7dc066982eb177cdebeaaa upstream.
>>
>> The original code did not free the old map. ÂThis patch fixes it.
>>
>> tj: use @old as memcpy source instead of @chunk->map, and indentation
>> Â Â and description update
>
> This patch, as part of the current -stable queue-2.6.35, breaks booting for
> me on nforce4/ AMD64 X2. Unfortunately it fails even before the serial
> console is initialized and the only messages shown on screen are:
>
> Decompressing Linux... Parsing ELF... done.
> Booting kernel.
>
> [...]
>> --- a/mm/percpu.c
>> +++ b/mm/percpu.c
>> @@ -390,7 +390,9 @@ static int pcpu_extend_area_map(struct p
>> Â Â Â Â Â Â Â goto out_unlock;
>>
>> Â Â Â old_size = chunk->map_alloc * sizeof(chunk->map[0]);
>> - Â Â memcpy(new, chunk->map, old_size);
>> + Â Â old = chunk->map;
>> +
>> + Â Â memcpy(new, old, old_size);
>>
>> Â Â Â /*
>> Â Â Â Â* map_alloc < PCPU_DFL_MAP_ALLOC indicates that the chunk is
>
> Reverting just this patch from the current queue-2.6.35 fixes the issue for
> me; gzipped kernel config (amd64) attached.
>
> Regards
> Â Â Â ÂStefan Lippers-Hollmann
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/