From 8dd433c495083611fd6a17ea34e9154fc3bc01db Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Thu, 16 Apr 2015 16:51:47 -0700 Subject: [PATCH] mm: showmem: make the notifiers atomic There are places in kernel like the lowmemorykiller which invokes show_mem_call_notifiers from an atomic context. So move from a blocking notifier to atomic. At present the notifier callbacks does not call sleeping functions, but it should be made sure, it does not happen in future also. Change-Id: I9668e67463ab8a6a60be55dbc86b88f45be8b041 Signed-off-by: Vinayak Menon --- mm/showmem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/showmem.c b/mm/showmem.c index ddad34ebb5d9..1103a02b2cbd 100644 --- a/mm/showmem.c +++ b/mm/showmem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -17,21 +17,21 @@ #include #include -BLOCKING_NOTIFIER_HEAD(show_mem_notifier); +ATOMIC_NOTIFIER_HEAD(show_mem_notifier); int show_mem_notifier_register(struct notifier_block *nb) { - return blocking_notifier_chain_register(&show_mem_notifier, nb); + return atomic_notifier_chain_register(&show_mem_notifier, nb); } int show_mem_notifier_unregister(struct notifier_block *nb) { - return blocking_notifier_chain_unregister(&show_mem_notifier, nb); + return atomic_notifier_chain_unregister(&show_mem_notifier, nb); } void show_mem_call_notifiers(void) { - blocking_notifier_call_chain(&show_mem_notifier, 0, NULL); + atomic_notifier_call_chain(&show_mem_notifier, 0, NULL); } static int show_mem_notifier_get(void *dat, u64 *val)