linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Pierre Ossman <drzeus@drzeus.cx>
Cc: Wu Fengguang <fengguang.wu@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"bugme-daemon@bugzilla.kernel.org"
	<bugme-daemon@bugzilla.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [Bug 12832] New: kernel leaks a lot of memory
Date: Wed, 11 Mar 2009 11:47:16 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0903111115010.3062@gandalf.stny.rr.com> (raw)
In-Reply-To: <20090311160223.638b4bc9@mjolnir.ossman.eu>



On Wed, 11 Mar 2009, Pierre Ossman wrote:

> On Wed, 11 Mar 2009 21:00:22 +0800
> Wu Fengguang <fengguang.wu@intel.com> wrote:
> 
> > 
> > I worked up a simple debugging patch. Since the missing pages are
> > continuously spanned, several stack dumping shall be enough to catch
> > the page consumer.
> > 
> > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > index 27b8681..c0df7fd 100644
> > --- a/mm/page_alloc.c
> > +++ b/mm/page_alloc.c
> > @@ -1087,6 +1087,13 @@ again:
> >  			goto failed;
> >  	}
> >  
> > +	/* wfg - hunting the 40000 missing pages */
> > +	{
> > +		unsigned long pfn = page_to_pfn(page);
> > +		if (pfn > 0x1000 && (pfn & 0xfff) <= 1)
> > +			dump_stack();
> > +	}
> > +
> >  	__count_zone_vm_events(PGALLOC, zone, 1 << order);
> >  	zone_statistics(preferred_zone, zone);
> >  	local_irq_restore(flags);
> 
> This got very noisy, but here's what was in the ring buffer once it had
> booted.
> 
> Note that this is where only the "noflags" pages have been allocated,
> not "lru".

BTW, which kernel are you testing?  2.6.27, ftrace had its own special 
buffering system. It played tricks with the page structs of the pages in 
the buffer. It used the lru parts of the pages to link list itself.
I just booted on a straight 2.6.27 with tracing configured.

# cat /debug/tracing/trace_entries 
65586

This is the old method to see the amount of data used. There are a total 
of 65,586 entries all of 88 bytes each:  5,771,568  And since we also have
a "snapshot" buffer for max latencies, the total is: 11,543,136. That is 
quite a lot of memory for one CPU :-/

Starting with 2.6.28, we now have the unified ring buffer. It removes all 
of the page struct hackery in the original code.

In 2.6.28, the trace_entries is a misnomer. The conversion to the ring 
buffer brought had the change from representing the number of entries 
(entries in the ring buffer are now variable length) and the count is the 
number of bytes each CPU buffer takes up (*2 because of the "snapshot" 
buffer).

# cat /debug/tracing/trace_entries 
1441792

Now we have 1,441,792 or about 3 megs as the default.

Today, we now have it as:

# cat /debug/tracing/buffer_size_kb 
1410


Still the 3 megs. But going from 10Megs a CPU, to 3Megs is a big 
difference. Do you see the same amout of lost memory with the later 
kernels?

I'll have to make the option to expand the ring buffer when a tracer is 
registered. That will be the default option.

-- Steve

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-03-11 15:47 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-12832-27@http.bugzilla.kernel.org/>
2009-03-07 20:24 ` Andrew Morton
2009-03-07 21:00   ` Pierre Ossman
2009-03-07 22:13     ` Andrew Morton
2009-03-07 22:53       ` Pierre Ossman
2009-03-08 10:00       ` Pierre Ossman
2009-03-08 10:36         ` Pierre Ossman
2009-03-08 12:38           ` Wu Fengguang
2009-03-08 14:26             ` Pierre Ossman
2009-03-08 15:54             ` Pierre Ossman
2009-03-08 19:11               ` Andrew Morton
2009-03-08 19:23                 ` Pierre Ossman
2009-03-07 22:16     ` Andrew Morton
2009-03-09  1:37     ` Wu Fengguang
     [not found]       ` <20090309020701.GA381@localhost>
2009-03-09  7:40         ` Pierre Ossman
2009-03-09 14:22           ` Wu Fengguang
2009-03-09 15:02             ` Pierre Ossman
2009-03-10  2:41               ` Wu Fengguang
2009-03-10  6:56                 ` Pierre Ossman
2009-03-10  8:19                 ` Wu Fengguang
2009-03-10  9:55                   ` Pierre Ossman
2009-03-10 12:22                     ` Wu Fengguang
2009-03-10 13:11                       ` Wu Fengguang
2009-03-10 15:52                         ` Pierre Ossman
2009-03-10 20:21                         ` Pierre Ossman
2009-03-11  1:37                           ` Wu Fengguang
     [not found]                             ` <20090311075703.35de2488@mjolnir.ossman.eu>
2009-03-11  7:14                               ` Wu Fengguang
2009-03-11  7:26                                 ` Pierre Ossman
2009-03-11  7:36                                   ` Wu Fengguang
2009-03-11  7:57                                     ` Pierre Ossman
2009-03-11  8:20                                       ` Wu Fengguang
2009-03-11 13:05                                         ` Pierre Ossman
2009-03-11 13:00                                       ` Wu Fengguang
2009-03-11 15:02                                         ` Pierre Ossman
2009-03-11 15:47                                           ` Steven Rostedt [this message]
2009-03-11 16:46                                             ` Pierre Ossman
2009-03-11 21:43                                               ` Pierre Ossman
2009-03-12  6:50                                                 ` Pierre Ossman
2009-03-12  1:08                                           ` Wu Fengguang
2009-03-12  6:55                                             ` Pierre Ossman
2009-03-12  7:29                                               ` Wu Fengguang
2009-03-11 14:25                                     ` Steven Rostedt
2009-03-11 14:35                                       ` Pierre Ossman
2009-03-11 16:55                                       ` Pierre Ossman
2009-03-11 17:28                                         ` Steven Rostedt
2009-03-11 18:33                                           ` Pierre Ossman
2009-03-11 18:48                                             ` Steven Rostedt
2009-03-11 18:56                                               ` Pierre Ossman
2009-03-11 19:03                                                 ` Steven Rostedt
2009-03-12  2:46                                                   ` KOSAKI Motohiro
2009-03-12  6:53                                                     ` Pierre Ossman
2009-03-10 19:58                       ` Pierre Ossman
2009-03-11  0:19                     ` KOSAKI Motohiro
2009-03-11  7:22                       ` Pierre Ossman

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=alpine.DEB.2.00.0903111115010.3062@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=drzeus@drzeus.cx \
    --cc=fengguang.wu@intel.com \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    /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