staging: android: lowmemorykiller: select a new task to kill

Under certain circumstances, a process may take time to handle a SIGKILL.
When lowmemkiller is called again shortly after, it would pick the same
process to kill over and over, so that we cann't get free memory for long time.

Solution is to check fatal_signal_pending() on the selected task, and if it's
already pending, select a new task to kill.

Cherry-pick 5e3358093351e5d48e21250e31896b855542f22c
Reviewed-on: http://gerrit.pcs.mot.com/479831

Change-Id: I53445114451ffaba293f3c7174fb0b01ed0d34b6
Signed-off-by: Tianshui Shi <kfp634@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/505410
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit da093001caf06ed2296b4f79c84cc48ce713eac6)
staging: android: persistent_ram: allow printing to old buf

This change adds interface which can be used to print to old
persistent ram. We'll be able to add some useful annotations
to last_kmsg.

Change-Id: I4b6aaaaf3285d31b2e1ac0244d7ba01399bb7fa6
Signed-off-by: Yuanyuan Zhong <a6510c@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/504784
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Yi-Wei Zhao <gbjc64@motorola.com>
Reviewed-by: Jason Hrycay <jason.hrycay@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
(cherry picked from commit 616fadfe57503a765d3034fa33dab0445d3f1967)
staging: android: binder:add ioctl BINDER_GET_PEER_PID

Add new ioctl BINDER_GET_PEER_PID to let user-space app to
inquire peer's pid of current transaction.

This is ported from

 *(CR): Scorpion_mini:UT: System Server Watchdog
  Reviewed-on: http://gerrit.pcs.mot.com/466351

Change-Id: Idfffd7e3bb9a81e52068ba599c25e605b612675e
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/506479
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
(cherry picked from commit 40b6938286a96c80f27ad9ccbe013b44599dd9ad)
staging: android: persistent_ram: free temporary buffer

When there is no valid old persistent_ram buffer, we need to free
the temporary buffers which are supposed to be merged into old
persistent_ram buffer.

Change-Id: I2fc06dbb78a98f0734fc866fa7ef92a140578bb7
Signed-off-by: Yuanyuan Zhong <a6510c@motorola.com>
Reviewed-on: http://gerrit.pcs.mot.com/508951
Tested-by: Jira Key <JIRAKEY@motorola.com>
Reviewed-by: Jeffrey Carlyle <jeff.carlyle@motorola.com>
Reviewed-by: Igor Kovalenko <cik009@motorola.com>
(cherry picked from commit f540c1b3bf666ee1a5f288e76e2774293b3ed5e9)