From 6ab030c573837f4b22675ecae4cbb71e8ce7260c Mon Sep 17 00:00:00 2001 From: KOSAKI Motohiro Date: Thu, 2 Dec 2010 14:31:20 -0800 Subject: [PATCH] --- yaml --- r: 222872 b: refs/heads/master c: a0b0f58cdd32ab363a600a294ddaa90f0c32de8c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/ksm.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 7692219240a4..7f5d8e219cb6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 20d6c96b5f1cad5c5da4641945ec17a1d9a1afc8 +refs/heads/master: a0b0f58cdd32ab363a600a294ddaa90f0c32de8c diff --git a/trunk/mm/ksm.c b/trunk/mm/ksm.c index 65ab5c7067d9..43bc893470b4 100644 --- a/trunk/mm/ksm.c +++ b/trunk/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: