netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Robert Olsson <Robert.Olsson@data.slu.se>
Cc: Andrew Morton <akpm@osdl.org>,
	torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz,
	linux-kernel@vger.kernel.org, netdev@oss.sgi.com
Subject: Re: Memory leak in 2.6.11-rc1?
Date: Thu, 27 Jan 2005 16:49:18 +0000	[thread overview]
Message-ID: <20050127164918.C3036@flint.arm.linux.org.uk> (raw)
In-Reply-To: <16888.58622.376497.380197@robur.slu.se>; from Robert.Olsson@data.slu.se on Thu, Jan 27, 2005 at 01:56:30PM +0100

On Thu, Jan 27, 2005 at 01:56:30PM +0100, Robert Olsson wrote:
> 
> Andrew Morton writes:
>  > Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> 
>  > >  ip_dst_cache        1292   1485    256   15    1
> 
>  > I guess we should find a way to make it happen faster.
>  
> Here is route DoS attack. Pure routing no NAT no filter.
> 
> Start
> =====
> ip_dst_cache           5     30    256   15    1 : tunables  120   60    8 : slabdata      2      2      0
> 
> After DoS
> =========
> ip_dst_cache       66045  76125    256   15    1 : tunables  120   60    8 : slabdata   5075   5075    480
> 
> After some GC runs.
> ==================
> ip_dst_cache           2     15    256   15    1 : tunables  120   60    8 : slabdata      1      1      0
> 
> No problems here. I saw Martin talked about NAT...

Yes, I can reproduce that same behaviour, where I can artificially
inflate the DST cache and the GC does run and trims it back down to
something reasonable.

BUT, over time, my DST cache just increases in size and won't trim back
down.  Not even by writing to the /proc/sys/net/ipv4/route/flush sysctl
(which, if I'm reading the code correctly - and would be nice to know
from those who actually know this stuff - should force an immediate
flush of the DST cache.)

For instance, I have (in sequence):

# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
581
ip_dst_cache        1860   1860    256   15    1 : tunables  120   60    0 : slabdata    124    124      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
717
ip_dst_cache        1995   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
690
ip_dst_cache        1995   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
696
ip_dst_cache        1995   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
700
ip_dst_cache        1995   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
718
ip_dst_cache        1993   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
653
ip_dst_cache        1993   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
667
ip_dst_cache        1956   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
620
ip_dst_cache        1944   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
623
ip_dst_cache        1920   1995    256   15    1 : tunables  120   60    0 : slabdata    133    133      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
8
ip_dst_cache        1380   1980    256   15    1 : tunables  120   60    0 : slabdata    132    132      0
# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo
86
ip_dst_cache        1375   1875    256   15    1 : tunables  120   60    0 : slabdata    125    125      0

so obviously the GC does appear to be working - as can be seen from the
number of entries in /proc/net/rt_cache.  However, the number of objects
in the slab cache does grow day on day.  About 4 days ago, it was only
about 600 active objects.  Now it's more than twice that, and it'll
continue increasing until it hits 8192, where upon it's game over.

And, here's the above with /proc/net/stat/rt_cache included:

# cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo; cat /proc/net/stat/rt_cache
61
ip_dst_cache        1340   1680    256   15    1 : tunables  120   60    0 : slabdata    112    112      0
entries  in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_src  out_hit out_slow_tot out_slow_mc  gc_total gc_ignored gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search
00000538  005c9f10 0005e163 00000000 00000013 000002e2 00000000 00000005  003102e3 00038f6d 00000000 0007887a 0005286d 00001142 00000000 00138855 0010848d

notice how /proc/net/stat/rt_cache says there's 1336 entries in the
route cache.  _Where_ are they?  They're not there according to
/proc/net/rt_cache.

(PS, the formatting of the headings in /proc/net/stat/rt_cache doesn't
appear to tie up with the formatting of the data which is _really_
confusing.)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  parent reply	other threads:[~2005-01-27 16:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050121161959.GO3922@fi.muni.cz>
     [not found] ` <1106360639.15804.1.camel@boxen>
     [not found]   ` <20050123091154.GC16648@suse.de>
     [not found]     ` <20050123011918.295db8e8.akpm@osdl.org>
     [not found]       ` <20050123095608.GD16648@suse.de>
     [not found]         ` <20050123023248.263daca9.akpm@osdl.org>
2005-01-23 20:03           ` Memory leak in 2.6.11-rc1? Russell King
2005-01-24 11:48             ` Russell King
2005-01-25 19:32               ` Russell King
2005-01-27  8:28                 ` Russell King
2005-01-27  8:47                   ` Andrew Morton
2005-01-27 10:19                     ` Alessandro Suardi
2005-01-27 12:17                     ` Martin Josefsson
2005-01-27 12:56                     ` Robert Olsson
2005-01-27 13:03                       ` Robert Olsson
2005-01-27 16:49                       ` Russell King [this message]
2005-01-27 18:37                         ` Phil Oester
2005-01-27 19:25                           ` Russell King
2005-01-27 20:40                             ` Phil Oester
2005-01-28  9:32                               ` Russell King
2005-01-27 20:33                         ` David S. Miller
2005-01-28  0:17                           ` Russell King
2005-01-28  0:34                             ` David S. Miller
2005-01-28  8:58                               ` Russell King
2005-01-30 13:23                                 ` Russell King
2005-01-30 15:34                                   ` Russell King
2005-01-30 16:57                                     ` Phil Oester
2005-01-30 17:23                                   ` Patrick McHardy
2005-01-30 17:26                                     ` Patrick McHardy
2005-01-30 17:58                                       ` Patrick McHardy
2005-01-30 18:45                                         ` Russell King
2005-01-31  2:48                                         ` David S. Miller
2005-01-31  4:11                                         ` Herbert Xu
2005-01-31  4:45                                           ` YOSHIFUJI Hideaki / 吉藤英明
2005-01-31  5:00                                             ` Patrick McHardy
2005-01-31  5:11                                               ` David S. Miller
2005-01-31  5:40                                                 ` Herbert Xu
2005-01-31  5:16                                               ` YOSHIFUJI Hideaki / 吉藤英明
2005-01-31  5:42                                                 ` Yasuyuki KOZAKAI
2005-01-30 18:01                                       ` Russell King
2005-01-30 18:19                                         ` Phil Oester
2005-01-28  1:41                             ` Phil Oester

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=20050127164918.C3036@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=Robert.Olsson@data.slu.se \
    --cc=akpm@osdl.org \
    --cc=alexn@dsv.su.se \
    --cc=kas@fi.muni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=torvalds@osdl.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).