Skip to content

Commit

Permalink
staging, android: remove lowmemory killer from the tree
Browse files Browse the repository at this point in the history
Lowmemory killer is sitting in the staging tree since 2008 without any
serious interest for fixing issues brought up by the MM folks. The main
objection is that the implementation is basically broken by design:
	- it hooks into slab shrinker API which is not suitable for this
	  purpose. lowmem_count implementation just shows this nicely.
	  There is no scaling based on the memory pressure and no
	  feedback to the generic shrinker infrastructure.
	  Moreover lowmem_scan is called way too often for the heavy
	  work it performs.
	- it is not reclaim context aware - no NUMA and/or memcg
	  awareness.

As the code stands right now it just adds a maintenance overhead when
core MM changes have to update lowmemorykiller.c as well. It also seems
that the alternative LMK implementation will be solely in the userspace
so this code has no perspective it seems. The staging tree is supposed
to be for a code which needs to be put in shape before it can be merged
which is not the case here obviously.

Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Michal Hocko authored and gregkh committed Mar 9, 2017
1 parent 12ab165 commit 915e70f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 227 deletions.
10 changes: 0 additions & 10 deletions drivers/staging/android/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ config ASHMEM
It is, in theory, a good memory allocator for low-memory devices,
because it can discard shared memory units when under memory pressure.

config ANDROID_LOW_MEMORY_KILLER
bool "Android Low Memory Killer"
---help---
Registers processes to be killed when low memory conditions, this is useful
as there is no particular swap space on android.

The registered process will kill according to the priorities in android init
scripts (/init.rc), and it defines priority values with minimum free memory size
for each priority.

source "drivers/staging/android/ion/Kconfig"

endif # if ANDROID
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ ccflags-y += -I$(src) # needed for trace events
obj-y += ion/

obj-$(CONFIG_ASHMEM) += ashmem.o
obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
212 changes: 0 additions & 212 deletions drivers/staging/android/lowmemorykiller.c

This file was deleted.

4 changes: 0 additions & 4 deletions include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,6 @@ extern struct pid *cad_pid;
#define PFA_NO_NEW_PRIVS 0 /* May not gain new privileges. */
#define PFA_SPREAD_PAGE 1 /* Spread page cache over cpuset */
#define PFA_SPREAD_SLAB 2 /* Spread some slab caches over cpuset */
#define PFA_LMK_WAITING 3 /* Lowmemorykiller is waiting */


#define TASK_PFA_TEST(name, func) \
Expand All @@ -1282,9 +1281,6 @@ TASK_PFA_TEST(SPREAD_SLAB, spread_slab)
TASK_PFA_SET(SPREAD_SLAB, spread_slab)
TASK_PFA_CLEAR(SPREAD_SLAB, spread_slab)

TASK_PFA_TEST(LMK_WAITING, lmk_waiting)
TASK_PFA_SET(LMK_WAITING, lmk_waiting)

static inline void
tsk_restore_flags(struct task_struct *task, unsigned long orig_flags, unsigned long flags)
{
Expand Down

0 comments on commit 915e70f

Please sign in to comment.