Re: Memory leak with dev_add_pack()

2011-01-24 Thread Michael Blizek
Hi!

On 22:59 Sun 23 Jan , anish kumar wrote:
...
 ps:I dont have vanilla kernel where i could have changed the intitialisation 
 files to remount while booting and could have
 controlled the list of process running on the system.
 In android we are doing that in init.rc file need to check in ubuntu.

Why not type init 1 in a root shell?

-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Memory leak with dev_add_pack()

2011-01-24 Thread anish singh
On Mon, Jan 24, 2011 at 9:38 PM, Michael Blizek 
mic...@michaelblizek.twilightparadox.com wrote:

 Hi!

 On 22:59 Sun 23 Jan , anish kumar wrote:
 ...
  ps:I dont have vanilla kernel where i could have changed the
 intitialisation
  files to remount while booting and could have
  controlled the list of process running on the system.
  In android we are doing that in init.rc file need to check in ubuntu.

 Why not type init 1 in a root shell?


Thanks for this information but looks like this is not properly supported in
my ubuntu system as
after this command it is dropping to recovery menu.


-Michi
 --
 programing a layer 3+4 network protocol for mesh networks
 see http://michaelblizek.twilightparadox.com


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Memory leak with dev_add_pack()

2011-01-23 Thread Daniel Baluta
Hi Spiro,

 While it essentially works as I want it to, I found that I am leaking
 memory this way. Having this module in a highly loaded network,
 head -n5 /proc/meminfo shows that MemFree is steadily falling, until
 the kernel OOPS with an out of memory condition.

Have you considered using kmemleak [1] to help your debugging?

thanks,
Daniel.

[1] http://lxr.linux.no/linux+v2.6.37/Documentation/kmemleak.txt

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Memory leak with dev_add_pack()

2011-01-23 Thread anish kumar
 Hi!

 On 11:40 Sun 23 Jan , Spiro Trikaliotis wrote:
 ...
 * On Sat, Jan 22, 2011 at 08:18:05AM +0100 Michael Blizek wrote:
 ...
  - Which user grows is /proc/slabinfo? (If this file is emply or does 
  not
exist, you may meed to recompile the kernel to use slab instead of
sl[b-z]b)

 Thank you for the pointer, it might help.

 The objects which have changed the most on a mildly loaded network are:

 25000 buffer_head
  5000 dentry
  5000 ext3_inode_cache
  5000 size-64

 The number if the number of more active object after approx. 20h of
 letting it run on the mildly loaded network.

 Note that the ext3_inode_cache might have grown because I was regularly
 writing a new log file from slabinfo (slabinfo --once  slabinfo.`date
 +...`)

 Thus, I would expect I am leaking buffer_head.

 The funny point is that buffer_head belongs to the filesystem subsystem. 
 What
 file systems are you using? Could it be that your code just triggers the
 memory leak, because data is logged to disk, e.g. to /var/log/kern.log ?
I did small experiment with your code.I removed all your logs which were 
getting
logged in kernel buffers(kern.log).With this change i checked the meminfo 
and found that
the memory leaking is almost same as compared to normal case(with no change 
in your code).


 I have tried your program on my virtual machine (2.6.28) and could see any
 leak, but maybe data is leaked very slowly...
i confirm that data is leaking very slowly (below is the output i got on my 
ubuntu machine
with removed logs from your code).

$date
Sun Jan 23 19:13:47 RET 2011

$ head -n5 /proc/meminfo
MemTotal:1018172 kB
MemFree:  373708 kB
Buffers:   32232 kB
Cached:   296004 kB
SwapCached:0 kB

$ date
Sun Jan 23 19:15:03 RET 2011

$ head -n5 /proc/meminfo
MemTotal:1018172 kB
MemFree:  373584 kB
Buffers:   32248 kB
Cached:   296004 kB
SwapCached:0 kB

With logs enabled in your code i can see marginal increase in leaking 
memory.
I can defintely see the memory leaking with your ko and will investigate 
further as to the reason.
Hopefully kmemleak will lead us somewhere.


 -Michi
 -- 
 programing a layer 3+4 network protocol for mesh networks
 see http://michaelblizek.twilightparadox.com


 ___
 Kernelnewbies mailing list
 Kernelnewbies@kernelnewbies.org
 http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies 


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies