X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=mm%2Fksm.c;h=43bc893470b40512e26bdd129fb2194708bfbbdc;hb=551423748a4eba55f2eb0fc250d757986471f187;hp=65ab5c7067d994ad934c4f4bd5fd5809235a0756;hpb=7b6181e06841f5ad15c4ff708b967b4db65a64de;p=mv-sheeva.git diff --git a/mm/ksm.c b/mm/ksm.c index 65ab5c7067d..43bc893470b 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1724,8 +1724,13 @@ static int ksm_memory_callback(struct notifier_block *self, /* * Keep it very simple for now: just lock out ksmd and * MADV_UNMERGEABLE while any memory is going offline. + * mutex_lock_nested() is necessary because lockdep was alarmed + * that here we take ksm_thread_mutex inside notifier chain + * mutex, and later take notifier chain mutex inside + * ksm_thread_mutex to unlock it. But that's safe because both + * are inside mem_hotplug_mutex. */ - mutex_lock(&ksm_thread_mutex); + mutex_lock_nested(&ksm_thread_mutex, SINGLE_DEPTH_NESTING); break; case MEM_OFFLINE: