persistent_ram: check PERSISTENT_RAM_SIG before writing

if the PERSISTENT_RAM_SIG was corrupted, do not write something
to the persistent_ram buffer. this may cause the abnormal crash.

Change-Id: Ibd3082f7abeaa0e2e4b8f5022360977ec29add6f
persistent_ram: fix wrong error code

need to be "return -EINVAL" on error

Change-Id: Ie465ecc4ebf64e205994829af8b33481c6139b64
staging: android: lowmemorykiller: Add config option to support oom_adj values

The conversion to use oom_score_adj instead of the deprecated oom_adj
values breaks existing user-space code. Add a config option to convert
oom_adj values written to oom_score_adj values if they appear to be
valid oom_adj values.

Change-Id: I68308125059b802ee2991feefb07e9703bc48549
Signed-off-by: Arve Hjønnevåg <arve@android.com>
staging: android: lowmemorykiller: Don't count reserved free memory

The amount of reserved memory varies between devices. Subtract it
here to reduce the amount of devices specific tuning needed for the
minfree values.

Change-Id: I466ae8b18f5972f6f6d8b5a7d8c4ae69660de53a
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Revert "staging: android: ram_console: honor dmesg_restrict"

This reverts commit dd09979346813357200adf71b07003fc0a778089.

Change-Id: If3d555d89f9aea765961b90eb2cd65dd92a78949