harsh97 / compcache

Automatically exported from code.google.com/p/compcache
1 stars 0 forks source link

Deallocation of resources #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
# cat /sys/block/zram0/disksize 
0
# blockdev --getsz /dev/zram0
0
# echo 10000 >/sys/block/zram0/disksize 
# cat /sys/block/zram0/disksize 
8192
# blockdev --getsz /dev/zram0
16
# echo 1 >/sys/block/zram0/reset 
# cat /sys/block/zram0/disksize 
8192

It seems if you never used the device, the reset does not work.

# echo test >/dev/zram0
# cat /sys/block/zram0/disksize 
8192
# blockdev --getsz /dev/zram0
16
# echo 1 >/sys/block/zram0/reset 
# cat /sys/block/zram0/disksize 
0

After some bytes have been written to zram0, the reset works, but:

# blockdev --getsz /dev/zram0
16

Here a 0 would be expected.
May be these all are cosmetic problems, but it is also possible that some 
resources don't get really freed (?).

All done with vanilla 2.6.37 (including zram_fix_issue_83.patch).

regards

Original issue reported on code.google.com by fadb24bb...@drewag.de on 10 Feb 2011 at 2:08

GoogleCodeExporter commented 9 years ago
> May be these all are cosmetic problems, but it is also possible that some 
resources don't get really freed (?).

For now, I can confirm that we are not leaking any memory or any other 
resource, so just a cosmetic issue. I will fix it soon.

Thanks for pointing this out.
 - Nitin

Original comment by nitingupta910@gmail.com on 10 Feb 2011 at 9:34

GoogleCodeExporter commented 9 years ago
# echo 10000 >/sys/block/zram0/disksize 
# cat /sys/block/zram0/disksize 
8192

BTW. Shouldn't this be 16384  (10000 rounded up to 'sector' size)? Just to be 
safe.

Original comment by witold.b...@gmail.com on 18 May 2011 at 11:36

GoogleCodeExporter commented 9 years ago
> BTW. Shouldn't this be 16384  (10000 rounded up to 'sector' size)? Just to be 
safe.

zram rounds-down the given size of PAGE_SIZE (4K) which zram block size. So, we 
get 10000/4096*4096 = 8192

Original comment by nitingupta910@gmail.com on 21 May 2011 at 1:36

GoogleCodeExporter commented 9 years ago

Original comment by nitingupta910@gmail.com on 2 Oct 2012 at 10:08