linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Pierre Ossman <drzeus@drzeus.cx>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	bugme-daemon@bugzilla.kernel.org, linux-mm@kvack.org
Subject: Re: [Bug 12832] New: kernel leaks a lot of memory
Date: Mon, 9 Mar 2009 22:22:41 +0800	[thread overview]
Message-ID: <20090309142241.GA4437@localhost> (raw)
In-Reply-To: <20090309084045.2c652fbf@mjolnir.ossman.eu>

Hi Pierre,

On Mon, Mar 09, 2009 at 08:40:45AM +0100, Pierre Ossman wrote:
> On Mon, 9 Mar 2009 10:07:01 +0800
> Wu Fengguang <fengguang.wu@intel.com> wrote:
> 
> > On Mon, Mar 09, 2009 at 09:37:42AM +0800, Wu Fengguang wrote:
> > > 
> > > The "free" pages in sysrq mem-info report should be equal to "MemFree"
> > > in /proc/meminfo. So I'd expect meminfo numbers to be different in
> > > .26/.27 as well.
> > > 
> > > Maybe the memory is taken by some user space program, so it would be
> > > helpful to know the numbers in /proc/meminfo, /proc/vmstat and
> > > /proc/zoneinfo.
> > 
> > And maybe piggyback /proc/slabinfo in case it is a kernel bug :-)
> > 
> 
> Big dump of relevant /proc files:

Thanks for the data! Now it seems that some pages are totally missing
from bootmem or slabs or page cache or any application consumptions...

Will searching through /proc/kpageflags for reserved pages help
identify the problem?

Oh kpageflags_read() does not include support for PG_reserved:

        #define KPF_LOCKED     0
        #define KPF_ERROR      1
        #define KPF_REFERENCED 2
        #define KPF_UPTODATE   3
        #define KPF_DIRTY      4
        #define KPF_LRU        5
        #define KPF_ACTIVE     6
        #define KPF_SLAB       7
        #define KPF_WRITEBACK  8
        #define KPF_RECLAIM    9
        #define KPF_BUDDY     10

Thanks,
Fengguang

> [root@builder ~]# free
>              total       used       free     shared    buffers     cached
> Mem:        509108     236988     272120          0        228      14760
> -/+ buffers/cache:     222000     287108
> Swap:       524280        228     524052
> 
> [root@builder ~]# cat /proc/meminfo 
> MemTotal:       509108 kB
> MemFree:        272172 kB
> Buffers:           240 kB
> Cached:          14788 kB
> SwapCached:         64 kB
> Active:          32544 kB
> Inactive:         5900 kB
> SwapTotal:      524280 kB
> SwapFree:       524052 kB
> Dirty:            5980 kB
> Writeback:           0 kB
> AnonPages:       23404 kB
> Mapped:           8648 kB
> Slab:            23148 kB
> SReclaimable:     5420 kB
> SUnreclaim:      17728 kB
> PageTables:       3324 kB
> NFS_Unstable:        0 kB
> Bounce:              0 kB
> WritebackTmp:        0 kB
> CommitLimit:    778832 kB
> Committed_AS:    85196 kB
> VmallocTotal: 34359738367 kB
> VmallocUsed:      1740 kB
> VmallocChunk: 34359736619 kB
> HugePages_Total:     0
> HugePages_Free:      0
> HugePages_Rsvd:      0
> HugePages_Surp:      0
> Hugepagesize:     2048 kB
> DirectMap4k:      2032
> DirectMap2M:  18446744073709551613

This field looks weird.

> DirectMap1G:         0
> 
> [root@builder ~]# cat /proc/vmstat 
> nr_free_pages 68035
> nr_inactive 1479
> nr_active 8137
> nr_anon_pages 5851
> nr_mapped 2162
> nr_file_pages 3777
> nr_dirty 132
> nr_writeback 0
> nr_slab_reclaimable 1354
> nr_slab_unreclaimable 4440
> nr_page_table_pages 831
> nr_unstable 0
> nr_bounce 0
> nr_vmscan_write 324
> nr_writeback_temp 0
> numa_hit 18985527
> numa_miss 0
> numa_foreign 0
> numa_interleave 44220
> numa_local 18985527
> numa_other 0
> pgpgin 379025
> pgpgout 820238
> pswpin 16
> pswpout 57
> pgalloc_dma 295454
> pgalloc_dma32 18721928
> pgalloc_normal 0
> pgalloc_movable 0
> pgfree 19085491
> pgactivate 60797
> pgdeactivate 47199
> pgfault 25624481
> pgmajfault 2490
> pgrefill_dma 8144
> pgrefill_dma32 103508
> pgrefill_normal 0
> pgrefill_movable 0
> pgsteal_dma 4503
> pgsteal_dma32 179395
> pgsteal_normal 0
> pgsteal_movable 0
> pgscan_kswapd_dma 4999
> pgscan_kswapd_dma32 180546
> pgscan_kswapd_normal 0
> pgscan_kswapd_movable 0
> pgscan_direct_dma 0
> pgscan_direct_dma32 384
> pgscan_direct_normal 0
> pgscan_direct_movable 0
> pginodesteal 0
> slabs_scanned 153856
> kswapd_steal 183628
> kswapd_inodesteal 35303
> pageoutrun 3794
> allocstall 3
> pgrotated 72
> htlb_buddy_alloc_success 0
> htlb_buddy_alloc_fail 0
> 
> [root@builder ~]# cat /proc/zoneinfo 
> Node 0, zone      DMA
>   pages free     2524
>         min      12
>         low      15
>         high     18
>         scanned  0 (a: 27 i: 24)
>         spanned  4096
>         present  2180
>     nr_free_pages 2524
>     nr_inactive  0
>     nr_active    8
>     nr_anon_pages 8
>     nr_mapped    0
>     nr_file_pages 0
>     nr_dirty     0
>     nr_writeback 0
>     nr_slab_reclaimable 16
>     nr_slab_unreclaimable 7
>     nr_page_table_pages 15
>     nr_unstable  0
>     nr_bounce    0
>     nr_vmscan_write 292
>     nr_writeback_temp 0
>     numa_hit     295370
>     numa_miss    0
>     numa_foreign 0
>     numa_interleave 0
>     numa_local   295370
>     numa_other   0
>         protection: (0, 489, 489, 489)
>   pagesets
>     cpu: 0
>               count: 0
>               high:  0
>               batch: 1
>   vm stats threshold: 2
>   all_unreclaimable: 0
>   prev_priority:     12
>   start_pfn:         0
> Node 0, zone    DMA32
>   pages free     65515
>         min      700
>         low      875
>         high     1050
>         scanned  0 (a: 0 i: 0)
>         spanned  126960
>         present  125224
>     nr_free_pages 65515
>     nr_inactive  1482
>     nr_active    8137
>     nr_anon_pages 5843
>     nr_mapped    2162
>     nr_file_pages 3789
>     nr_dirty     128
>     nr_writeback 0
>     nr_slab_reclaimable 1331
>     nr_slab_unreclaimable 4429
>     nr_page_table_pages 816
>     nr_unstable  0
>     nr_bounce    0
>     nr_vmscan_write 32
>     nr_writeback_temp 0
>     numa_hit     18690260
>     numa_miss    0
>     numa_foreign 0
>     numa_interleave 44220
>     numa_local   18690260
>     numa_other   0
>         protection: (0, 0, 0, 0)
>   pagesets
>     cpu: 0
>               count: 69
>               high:  186
>               batch: 31
>   vm stats threshold: 6
>   all_unreclaimable: 0
>   prev_priority:     12
>   start_pfn:         4096
> 
> [root@builder ~]# cat /proc/slabinfo 
> slabinfo - version: 2.1
> # name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>
> rpc_inode_cache       39     39    832   39    8 : tunables    0    0    0 : slabdata      1      1      0
> nf_conntrack_expect      0      0    240   34    2 : tunables    0    0    0 : slabdata      0      0      0
> UDPv6                 34     34    960   34    8 : tunables    0    0    0 : slabdata      1      1      0
> TCPv6                 18     18   1792   18    8 : tunables    0    0    0 : slabdata      1      1      0
> kmalloc_dma-512       32     32    512   32    4 : tunables    0    0    0 : slabdata      1      1      0
> dm_snap_pending_exception    144    144    112   36    1 : tunables    0    0    0 : slabdata      4      4      0
> kcopyd_job             0      0    360   45    4 : tunables    0    0    0 : slabdata      0      0      0
> dm_uevent              0      0   2608   12    8 : tunables    0    0    0 : slabdata      0      0      0
> ext3_inode_cache     387   1554    768   42    8 : tunables    0    0    0 : slabdata     37     37      0
> ext3_xattr            46     46     88   46    1 : tunables    0    0    0 : slabdata      1      1      0
> journal_handle       170    170     24  170    1 : tunables    0    0    0 : slabdata      1      1      0
> journal_head          42     42     96   42    1 : tunables    0    0    0 : slabdata      1      1      0
> revoke_table         256    256     16  256    1 : tunables    0    0    0 : slabdata      1      1      0
> revoke_record        128    128     32  128    1 : tunables    0    0    0 : slabdata      1      1      0
> cfq_io_context        44     48    168   24    1 : tunables    0    0    0 : slabdata      2      2      0
> mqueue_inode_cache     36     36    896   36    8 : tunables    0    0    0 : slabdata      1      1      0
> isofs_inode_cache      0      0    616   26    4 : tunables    0    0    0 : slabdata      0      0      0
> hugetlbfs_inode_cache     28     28    584   28    4 : tunables    0    0    0 : slabdata      1      1      0
> dquot                  0      0    256   32    2 : tunables    0    0    0 : slabdata      0      0      0
> inotify_event_cache    612    612     40  102    1 : tunables    0    0    0 : slabdata      6      6      0
> fasync_cache      313798 313820     24  170    1 : tunables    0    0    0 : slabdata   1846   1846      0
> shmem_inode_cache    735    738    792   41    8 : tunables    0    0    0 : slabdata     18     18      0
> pid_namespace          0      0   2104   15    8 : tunables    0    0    0 : slabdata      0      0      0
> nsproxy                0      0     56   73    1 : tunables    0    0    0 : slabdata      0      0      0
> UNIX                  92     92    704   46    8 : tunables    0    0    0 : slabdata      2      2      0
> xfrm_dst_cache         0      0    384   42    4 : tunables    0    0    0 : slabdata      0      0      0
> ip_dst_cache          51     75    320   25    2 : tunables    0    0    0 : slabdata      3      3      0
> TCP                   19     19   1664   19    8 : tunables    0    0    0 : slabdata      1      1      0
> blkdev_integrity       0      0    120   34    1 : tunables    0    0    0 : slabdata      0      0      0
> blkdev_queue          34     34   1824   17    8 : tunables    0    0    0 : slabdata      2      2      0
> blkdev_requests       38     52    304   26    2 : tunables    0    0    0 : slabdata      2      2      0
> sock_inode_cache     138    138    704   46    8 : tunables    0    0    0 : slabdata      3      3      0
> file_lock_cache       42     42    192   42    2 : tunables    0    0    0 : slabdata      1      1      0
> taskstats             26     26    312   26    2 : tunables    0    0    0 : slabdata      1      1      0
> proc_inode_cache      90    162    600   27    4 : tunables    0    0    0 : slabdata      6      6      0
> sigqueue              25     25    160   25    1 : tunables    0    0    0 : slabdata      1      1      0
> radix_tree_node      623   2581    560   29    4 : tunables    0    0    0 : slabdata     89     89      0
> bdev_cache            42     42    768   42    8 : tunables    0    0    0 : slabdata      1      1      0
> sysfs_dir_cache     7084   7089     80   51    1 : tunables    0    0    0 : slabdata    139    139      0
> inode_cache         1505   1708    568   28    4 : tunables    0    0    0 : slabdata     61     61      0
> dentry              2555   4485    208   39    2 : tunables    0    0    0 : slabdata    115    115      0
> avc_node            1735   2128     72   56    1 : tunables    0    0    0 : slabdata     38     38      0
> buffer_head         1583   5472    112   36    1 : tunables    0    0    0 : slabdata    152    152      0
> mm_struct             75     78    832   39    8 : tunables    0    0    0 : slabdata      2      2      0
> vm_area_struct      2223   2438    176   46    2 : tunables    0    0    0 : slabdata     53     53      0
> files_cache           78     84    768   42    8 : tunables    0    0    0 : slabdata      2      2      0
> signal_cache         105    108    896   36    8 : tunables    0    0    0 : slabdata      3      3      0
> sighand_cache         85     90   2112   15    8 : tunables    0    0    0 : slabdata      6      6      0
> task_struct          141    145   5840    5    8 : tunables    0    0    0 : slabdata     29     29      0
> anon_vma             741    768     32  128    1 : tunables    0    0    0 : slabdata      6      6      0
> shared_policy_node     85     85     48   85    1 : tunables    0    0    0 : slabdata      1      1      0
> numa_policy           56     60    136   30    1 : tunables    0    0    0 : slabdata      2      2      0
> idr_layer_cache      269    270    536   30    4 : tunables    0    0    0 : slabdata      9      9      0
> kmalloc-4096         247    248   4096    8    8 : tunables    0    0    0 : slabdata     31     31      0
> kmalloc-2048         345    352   2048   16    8 : tunables    0    0    0 : slabdata     22     22      0
> kmalloc-1024         396    416   1024   32    8 : tunables    0    0    0 : slabdata     13     13      0
> kmalloc-512          297    320    512   32    4 : tunables    0    0    0 : slabdata     10     10      0
> kmalloc-256          985    992    256   32    2 : tunables    0    0    0 : slabdata     31     31      0
> kmalloc-128         1899   2016    128   32    1 : tunables    0    0    0 : slabdata     63     63      0
> kmalloc-64          6795   9600     64   64    1 : tunables    0    0    0 : slabdata    150    150      0
> kmalloc-32         20735  20736     32  128    1 : tunables    0    0    0 : slabdata    162    162      0
> kmalloc-16        138778 139264     16  256    1 : tunables    0    0    0 : slabdata    544    544      0
> kmalloc-8           8190   8192      8  512    1 : tunables    0    0    0 : slabdata     16     16      0
> kmalloc-192          972   1050    192   42    2 : tunables    0    0    0 : slabdata     25     25      0
> kmalloc-96          2815   2856     96   42    1 : tunables    0    0    0 : slabdata     68     68      0
> kmem_cache_node        0      0     64   64    1 : tunables    0    0    0 : slabdata      0      0      0
> 
> -- 
>      -- Pierre Ossman
> 
>   WARNING: This correspondence is being monitored by the
>   Swedish government. Make sure your server uses encryption
>   for SMTP traffic and consider using PGP for end-to-end
>   encryption.


--
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-09 14:23 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 [this message]
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
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=20090309142241.GA4437@localhost \
    --to=fengguang.wu@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=drzeus@drzeus.cx \
    --cc=linux-mm@kvack.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