Discussion:
How to enable zramfs in android...
sandeep kumar
2014-05-22 10:58:52 UTC
Permalink
Dear All,

we are trying to make use of zramfs. In our android based board,
we are seeing this output,

****@sandeep:/sys/block/zram0 # ls*
*ls*
*alignment_offset*
*bdi*
*capability*
*compr_data_size*
*dev*
*discard_alignment*
*disksize*
*ext_range*
*holders*
*inflight*
*initstate*
*invalid_io*
*mem_used_total*
*notify_free*
*num_reads*
*num_writes*
*orig_data_size*
*power*
*queue*
*range*
*removable*
*reset*
*ro*
*size*
*slaves*
*stat*
*subsystem*
*uevent*
*zero_pages*

*Does this mean zram is activated ?*

we are trying to do the operation to set disk size,
*echo $((50*1024*1024)) > /sys/block/zram0/disksize*

but still num_reads, num_writes is still zero.
Can you pls let us know how to enable zramfs?
--
With regards,
Sandeep Kumar Anantapalli,
Anders Darander
2014-05-22 11:26:19 UTC
Permalink
Post by sandeep kumar
Dear All,
we are trying to make use of zramfs. In our android based board,
we are seeing this output,
Does this mean zram is activated ?
Yes, zram is activated, otherwise you wouldn't have had zram0 created.

Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100 /dev/zram0`.
Well, '-p 100' isn't necessary, it's just to set the swap priority.
Post by sandeep kumar
we are trying to do the operation to set disk size,
echo $((50*1024*1024)) > /sys/block/zram0/disksize
This should have set the size of zram0.

Cheers,
Anders
--
Anders Darander
EPO guidelines 1978: "If the contribution to the known art resides
solely in a computer program then the subject matter is not
patentable in whatever manner it may be presented in the claims."
sandeep kumar
2014-05-23 08:48:37 UTC
Permalink
Dear Anders
Post by Anders Darander
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100 /dev/zram0`.
Well, '-p 100' isn't necessary, it's just to set the swap priority.
In my system /dev/zram0 is not present but sys/block/zram0 is present.
thats why i m having this doubt

thanks
sandeep


On Thu, May 22, 2014 at 4:56 PM, Anders Darander
Post by Anders Darander
Post by sandeep kumar
Dear All,
we are trying to make use of zramfs. In our android based board,
we are seeing this output,
Does this mean zram is activated ?
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100 /dev/zram0`.
Well, '-p 100' isn't necessary, it's just to set the swap priority.
Post by sandeep kumar
we are trying to do the operation to set disk size,
echo $((50*1024*1024)) > /sys/block/zram0/disksize
This should have set the size of zram0.
Cheers,
Anders
--
Anders Darander
EPO guidelines 1978: "If the contribution to the known art resides
solely in a computer program then the subject matter is not
patentable in whatever manner it may be presented in the claims."
--
With regards,
Sandeep Kumar Anantapalli,
sandeep kumar
2014-05-23 09:21:39 UTC
Permalink
Post by sandeep kumar
Post by sandeep kumar
In my system /dev/zram0 is not present but sys/block/zram0 is present.
thats why i m having this doubt
just now i found that we have zram0 in /dev/block/zram0
i tried the command you told,

****@kleoslte:/ # swapon -p 100 /dev/block/zram0*
*swapon -p 100 /dev/block/zram0*
*swapon failed for /dev/block/zram0*

is there anything else that i can try?
Post by sandeep kumar
Dear Anders
Post by sandeep kumar
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100
/dev/zram0`.
Post by sandeep kumar
Well, '-p 100' isn't necessary, it's just to set the swap priority.
In my system /dev/zram0 is not present but sys/block/zram0 is present.
thats why i m having this doubt
thanks
sandeep
On Thu, May 22, 2014 at 4:56 PM, Anders Darander <
Post by sandeep kumar
Post by sandeep kumar
Dear All,
we are trying to make use of zramfs. In our android based board,
we are seeing this output,
Does this mean zram is activated ?
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100 /dev/zram0`.
Well, '-p 100' isn't necessary, it's just to set the swap priority.
Post by sandeep kumar
we are trying to do the operation to set disk size,
echo $((50*1024*1024)) > /sys/block/zram0/disksize
This should have set the size of zram0.
Cheers,
Anders
--
Anders Darander
EPO guidelines 1978: "If the contribution to the known art resides
solely in a computer program then the subject matter is not
patentable in whatever manner it may be presented in the claims."
--
With regards,
Sandeep Kumar Anantapalli,
--
With regards,
Sandeep Kumar Anantapalli,
Corey Sheldon
2014-05-23 12:38:16 UTC
Permalink
works on linux desktop may also work on android:


cat /proc/swaps: (should readout)
/dev/block/zram0 52M (as kb readout most likely)

if it shows a different slice path (/dev/zram0 for example) use swapon
/that/mapping/path

also try swapon -p 100 -v -a /dev/block/zram0 as this adds the following
flags to activate ALL visible swaps and add a verbose function to create
readout that may help in debuging issue

Corey W Sheldon
Owner, 1st Class Mobile Shine
310.909.7672
www.facebook.com/1stclassmobileshine
Post by sandeep kumar
Post by sandeep kumar
Post by sandeep kumar
In my system /dev/zram0 is not present but sys/block/zram0 is present.
thats why i m having this doubt
just now i found that we have zram0 in /dev/block/zram0
i tried the command you told,
*swapon -p 100 /dev/block/zram0*
*swapon failed for /dev/block/zram0*
is there anything else that i can try?
Post by sandeep kumar
Dear Anders
Post by sandeep kumar
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100
/dev/zram0`.
Post by sandeep kumar
Well, '-p 100' isn't necessary, it's just to set the swap priority.
In my system /dev/zram0 is not present but sys/block/zram0 is present.
thats why i m having this doubt
thanks
sandeep
On Thu, May 22, 2014 at 4:56 PM, Anders Darander <
Post by sandeep kumar
Post by sandeep kumar
Dear All,
we are trying to make use of zramfs. In our android based board,
we are seeing this output,
Does this mean zram is activated ?
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100 /dev/zram0`.
Well, '-p 100' isn't necessary, it's just to set the swap priority.
Post by sandeep kumar
we are trying to do the operation to set disk size,
echo $((50*1024*1024)) > /sys/block/zram0/disksize
This should have set the size of zram0.
Cheers,
Anders
--
Anders Darander
EPO guidelines 1978: "If the contribution to the known art resides
solely in a computer program then the subject matter is not
patentable in whatever manner it may be presented in the claims."
--
With regards,
Sandeep Kumar Anantapalli,
--
With regards,
Sandeep Kumar Anantapalli,
_______________________________________________
Kernelnewbies mailing list
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
V***@vt.edu
2014-05-24 01:51:09 UTC
Permalink
Post by Corey Sheldon
cat /proc/swaps: (should readout)
/dev/block/zram0 52M (as kb readout most likely)
if it shows a different slice path (/dev/zram0 for example) use swapon
/that/mapping/path
It won't show /dev/block/zram0 untin you've *already* done a swapon for that pathname ;)
sandeep kumar
2014-05-26 11:05:41 UTC
Permalink
Dear All

Thanks for your help. I could activate zram0, after doing the mkswap on the
device.

These all steps i followed,

echo 50M > /sys/block/zram0/disksize
mkswap /dev/block/zram0
swapon -p 100 /dev/block/zram0

after that, i saw my swap partition is being used. From the stats i saw
44MB RAM data is compressed into 14MB.

But i have a doubt, When i reserve 50M RAM for swap partition, is it like a
carve out memory?
i mean Kernel cant use this anymore?
Um, well that sounds pretty weird.
Have you checked that you've loaded that module? If so, I guess there's
something wrong with modprobe stuff that it didn't mknod for zram, so
try mknod for zram manually.
Check your /dev/block/ directory for the device numbers. On my box it
was 254:0 254:1 which were mapped to my zram0 and zram1 respectively.
mknod /dev/zram0 b 254 0
It should create a suitable /dev/zram* for you. Then try mkswap-swapon
procedure as others suggest. Please notice that -p argument for swapon is
somehow
necessary since on my gentoo box the priority of swap devices is set minus
by default. So your system may not use the zram swap at all even if
you've successfully create the zram device for it.
Please let my know if it still doesn't work :-)
Post by sandeep kumar
Post by sandeep kumar
Post by sandeep kumar
In my system /dev/zram0 is not present but sys/block/zram0 is present.
thats why i m having this doubt
just now i found that we have zram0 in /dev/block/zram0
i tried the command you told,
*swapon -p 100 /dev/block/zram0*
*swapon failed for /dev/block/zram0*
is there anything else that i can try?
On Fri, May 23, 2014 at 2:18 PM, sandeep kumar <
Post by sandeep kumar
Dear Anders
Post by sandeep kumar
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100
/dev/zram0`.
Post by sandeep kumar
Well, '-p 100' isn't necessary, it's just to set the swap priority.
In my system /dev/zram0 is not present but sys/block/zram0 is present.
thats why i m having this doubt
thanks
sandeep
On Thu, May 22, 2014 at 4:56 PM, Anders Darander <
Post by sandeep kumar
Post by sandeep kumar
Dear All,
we are trying to make use of zramfs. In our android based board,
we are seeing this output,
Does this mean zram is activated ?
Yes, zram is activated, otherwise you wouldn't have had zram0 created.
Though you might not be using it...
If you want to use it for swap, you'll have to run `swapon -p 100 /dev/zram0`.
Well, '-p 100' isn't necessary, it's just to set the swap priority.
Post by sandeep kumar
we are trying to do the operation to set disk size,
echo $((50*1024*1024)) > /sys/block/zram0/disksize
This should have set the size of zram0.
Cheers,
Anders
--
Anders Darander
EPO guidelines 1978: "If the contribution to the known art resides
solely in a computer program then the subject matter is not
patentable in whatever manner it may be presented in the claims."
--
With regards,
Sandeep Kumar Anantapalli,
--
With regards,
Sandeep Kumar Anantapalli,
_______________________________________________
Kernelnewbies mailing list
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
--
Best regards
Chen, Yiqun
--
With regards,
Sandeep Kumar Anantapalli,
Loading...