public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stefan Lippers-Hollmann" <s.L-H@gmx.de>
To: Huang Shijie <shijie8@gmail.com>
Cc: gregkh@suse.de, linux-kernel@vger.kernel.org, tj@kernel.org,
	stable@kernel.org
Subject: Re: Patch "percpu: fix a memory leak in pcpu_extend_area_map()" has been added to the 2.6.35-stable tree
Date: Fri, 17 Sep 2010 14:25:08 +0200	[thread overview]
Message-ID: <201009171425.20738.s.L-H@gmx.de> (raw)
In-Reply-To: <AANLkTikhf-qz5bHT=V1P-Osyxhhgx+2OJgjqVWzEsOGn@mail.gmail.com>

Hi

On Friday 17 September 2010, Huang Shijie wrote:
> 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():
> 
>         ================================
[...]
--- 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
@@ -410,8 +412,11 @@ out_unlock:
 	 * pcpu_mem_free() might end up calling vfree() which uses
 	 * IRQ-unsafe lock and thus can't be called under pcpu_lock.
 	 */
+	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__);
 
 	return 0;
 }
>         ================================
>   The system will print the log before it hung.

Unfortunately those printk lines aren't reached and the systems freezes
earlier.

> Best Regards.
> Huang Shijie
> 
> 
> 2010/9/17 Stefan Lippers-Hollmann <s.L-H@gmx.de>:
[...]
> >> 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@gmail.com>
> >> Date: Sun, 8 Aug 2010 14:39:07 +0200
> >> Subject: percpu: fix a memory leak in pcpu_extend_area_map()
[...]
> > 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.

I'm still stuck on those lines, before the system freezes, but I can 
reproduce the same issues in Intel Q9550/ ICH10 (x86_64) and Intel 
Pentium M (Banias)/ ICH4-M.

All systems use current Debian/ unstable (gcc-4.4 4.4.4-14, binutils 
2.20.1-14) and are booted by grub2 (grub-pc 1.98+20100804-4). 
Queue-2.6.35 with this patch backed out and current linux-2.6 HEAD 
(v2.6.36-rc4-134-g03a7ab0) are working fine on all tested systems.

Regards
	Stefan Lippers-Hollmann

      reply	other threads:[~2010-09-17 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <12845915543097@site>
2010-09-16 21:39 ` Patch "percpu: fix a memory leak in pcpu_extend_area_map()" has been added to the 2.6.35-stable tree Stefan Lippers-Hollmann
2010-09-16 22:47   ` Greg KH
2010-09-16 23:37     ` Stefan Lippers-Hollmann
2010-09-17  2:43   ` Huang Shijie
2010-09-17 12:25     ` Stefan Lippers-Hollmann [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=201009171425.20738.s.L-H@gmx.de \
    --to=s.l-h@gmx.de \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shijie8@gmail.com \
    --cc=stable@kernel.org \
    --cc=tj@kernel.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