linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	andrea@cpushare.com, "Eric W. Biederman" <ebiederm@xmission.com>,
	Linux Containers <containers@lists.osdl.org>,
	Daniel Lezcano <dlezcano@fr.ibm.com>,
	Pavel Emelianov <xemul@openvz.org>
Subject: Re: pidns memory leak
Date: Mon, 2 Nov 2009 16:38:18 -0600	[thread overview]
Message-ID: <20091102223818.GA15628@us.ibm.com> (raw)
In-Reply-To: <20091102133326.e3dc51fb.akpm@linux-foundation.org>

Quoting Andrew Morton (akpm@linux-foundation.org):
> On Tue, 13 Oct 2009 23:15:33 -0700
> Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> wrote:
> 
> > Daniel Lezcano [dlezcano@fr.ibm.com] wrote:
> > > Sukadev Bhattiprolu wrote:
> > >> Ccing  Andrea's new email id:
> > >>
> > >> Daniel Lezcano [dlezcano@fr.ibm.com] wrote:
> > >>   
> > >>> Following your explanation I was able to reproduce a simple program   
> > >>> added in attachment. But there is something I do not understand is 
> > >>> why  the leak does not appear if I do the 'lstat' (cf. test program) 
> > >>> in the  pid 2 context.
> > >>>     
> > >>
> > >> Hmm, are you sure there is no leak with this test program ? If I put back
> > >> the commit (7766755a2f249e7), I do see a leak in all three data structures
> > >> (pid_2, proc_inode, pid_namespace).
> > >>   
> > >
> > > Let me clarify :)
> > >
> > > The program leaks with the commit 7766755a2f249e7 and does not leak  
> > > without this commit.
> > > This is the expected behaviour and this simple program spots the problem.
> > >
> > > I tried to modify the program and I moved the lstat to the process 2 in  
> > > the child namespace. Conforming your analysis, I was expecting to see a  
> > > leak too, but this one didn't occur. I was wondering why, maybe there is  
> > > something I didn't understood in the analysis.
> > 
> > Hmm, There are two separate dentries associated with the processes.
> > One in each mount of /proc. The proc dentries in the child container
> > are freed when the child container unmounts its /proc so you don't see
> > the leak when the lstat() is inside the container.
> > 
> > When the lstat() is in the root container, it is accessing proc-dentries
> > from the _root container_ - They are supposed to  be flushed when the task
> > exits (but the above commit prevents that flush). They should be freed
> > when the /proc in root container is unmounted - and leak until then ?
> > 
> 
> This bug hasn't been fixed yet, has it?

Well Suka did trace the bug to commit 7766755a2f249e7, and posted a patch
to revert that, acked by Eric on Oct 20.  Suka, were you going to repost
that patch?

-serge

  reply	other threads:[~2009-11-02 22:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-02 12:27 pidns memory leak Daniel Lezcano
2009-10-06  4:05 ` Sukadev Bhattiprolu
2009-10-06  8:18   ` Daniel Lezcano
2009-10-08  3:08     ` Sukadev Bhattiprolu
2009-10-08  8:11       ` Daniel Lezcano
2009-10-09  3:29         ` Sukadev Bhattiprolu
2009-10-09 13:18           ` Daniel Lezcano
2009-10-09 20:38             ` Sukadev Bhattiprolu
2009-10-09 20:50               ` Eric W. Biederman
2009-10-10  1:58                 ` Sukadev Bhattiprolu
2009-10-10  2:08                   ` Eric W. Biederman
2009-10-09 21:54             ` Matt Helsley
2009-10-10  1:32             ` Sukadev Bhattiprolu
2009-10-12  8:41               ` Daniel Lezcano
2009-10-14  6:15                 ` Sukadev Bhattiprolu
2009-11-02 21:33                   ` Andrew Morton
2009-11-02 22:38                     ` Serge E. Hallyn [this message]
2009-11-02 22:47                       ` Andrew Morton
2009-11-03  7:24                         ` Cedric Le Goater
2009-11-03  8:41                           ` Eric W. Biederman
2009-11-03  9:24                             ` Cedric Le Goater

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=20091102223818.GA15628@us.ibm.com \
    --to=serue@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@cpushare.com \
    --cc=containers@lists.osdl.org \
    --cc=dlezcano@fr.ibm.com \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sukadev@linux.vnet.ibm.com \
    --cc=xemul@openvz.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;
as well as URLs for NNTP newsgroup(s).