Jump to content

How to pre-set swappiness in ROM? [SOLVED]


Guest twrock

Recommended Posts

I'm trying to put the final touches on a couple of roms, and I'm frustrated by not being able to pre-set swappiness. Yes, I know people can just set it themselves after the initial boot, but I'd like to pre-set it to something much more realistic than the kernel default of 60, because it creates terrible lag on most of our phones.

I've attempted to add a script to init.d with this line:

echo "15" > /proc/sys/vm/swappiness

I also tried to add that line to sysctl.conf, but no luck. It doesn't change it.

Any help would be appreciated.

Edited by twrock
Link to comment
Share on other sites

Only guess.

I'd think the proper place would be init.rc located on RAMDISK.

I see similar entries there:


	write /proc/sys/vm/overcommit_memory 1

	write /proc/sys/vm/min_free_order_shift 4


	# Tweak background writeout

	write /proc/sys/vm/dirty_expire_centisecs 200

	write /proc/sys/vm/dirty_background_ratio  5

But may be I'm wrong. Probably worth to experiment if not yet.

Link to comment
Share on other sites

Only guess.

I'd think the proper place would be init.rc located on RAMDISK.

I see similar entries there:


	write /proc/sys/vm/overcommit_memory 1

	write /proc/sys/vm/min_free_order_shift 4


	# Tweak background writeout

	write /proc/sys/vm/dirty_expire_centisecs 200

	write /proc/sys/vm/dirty_background_ratio  5

But may be I'm wrong. Probably worth to experiment if not yet.

Thanks, I'll check that out.

From this thread, I see that there must be some way to do it in an init.d script or in sysctl.conf, but I can't get it to work: http://forum.xda-developers.com/showthread.php?t=1289539

So it seems I must still be doing something wrong. (There is a lot I don't understand about all of this.)

Thanks again for the idea.

Link to comment
Share on other sites

Fibble did it. Ask him.

I should go look to see where he is "hanging out" these days. His PM is turned off, so I can't get to him that way. If I was smarter, I'd register for the "developer" forum, but those really smart guys intimidate me. :unsure:

Link to comment
Share on other sites

Add the command to init.qcom.sh in the boot.img and it should take effect on each boot.

Great! Thanks. (And thanks to D-D- as well.)

Do I assume correctly that it can still be set to something different via the "a2sd swappy??" command after doing that?

I'll see what I can do tomorrow to get things working, but now I've really got to get to bed.:blink:

Edited by twrock
Link to comment
Share on other sites

Add the command to init.qcom.sh in the boot.img and it should take effect on each boot.

Hmm, no init.qcom.sh in this boot.img. I think Tom took it out and put those settings directly into init.qcom.rc.

Link to comment
Share on other sites

Well still it's not a bad thing. I mean, after installing the rom, u need to change it only once, right? It's not with the thing we had to do before the command a2sd swappy was available, right?

Link to comment
Share on other sites

Only guess.

I'd think the proper place would be init.rc located on RAMDISK.

I see similar entries there:


	write /proc/sys/vm/overcommit_memory 1

	write /proc/sys/vm/min_free_order_shift 4


	# Tweak background writeout

	write /proc/sys/vm/dirty_expire_centisecs 200

	write /proc/sys/vm/dirty_background_ratio  5
But may be I'm wrong. Probably worth to experiment if not yet.
Pier, that was it! Thanks much. For future reference and clarification for anyone who stumbles onto this thread later: I was trying to modify a CM6.1 rom to reduce the original swappiness to 15 (down from 60). I added the following to the init.rc file in the ramdisk of the boot.img:
write /proc/sys/vm/swappiness 15

Link to comment
Share on other sites

Glad you sorted it. I'm getting my devices mixed up and I did forget what files the Pulse use!

It was just Tom's 2.2 boot.img that had gotten rid of it, so I don't think your memory was that bad. ;)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.