OSDN Git Service

lowmemorykiller: don't unregister notifier from atomic context
authorRabin Vincent <rabin.vincent@stericsson.com>
Thu, 9 Sep 2010 05:18:21 +0000 (10:48 +0530)
committerBrian Swetland <swetland@google.com>
Tue, 29 Mar 2011 20:58:01 +0000 (13:58 -0700)
commit1b3acaa9084f0de972add6bd939bb2ab3554ca82
tree632a42b3b5a228437ce3c8a3b547f2df342aca05
parent77f956f1042713117f81440ed7b939360ffb993d
lowmemorykiller: don't unregister notifier from atomic context

The lowmemorykiller registers an atomic notifier for notfication of when
the task is freed.  From this atomic notifier callback, it removes the
atomic notifier via task_free_unregister().  This is incorrect because
atomic_notifier_chain_unregister() calls syncronize_rcu(), which can
sleep, which shouldn't be done from an atomic notifier.

Fix this by registering the notifier during init, and only unregister it
if the lowmemorykiller is unloaded.

Change-Id: I1577b04e617bc2b2e39dcb490fcfc9ce660eb7ec
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
drivers/staging/android/lowmemorykiller.c