From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm <linux-mm@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [BUGFIX][PATCH] memory hotplug: fix notiier chain return value (Was Re: 2.6.28-rc4 mem_cgroup_charge_common panic)
Date: Thu, 13 Nov 2008 20:27:58 +0900 [thread overview]
Message-ID: <20081113202758.2f12915a.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <1226353408.8805.12.camel@badari-desktop>
Badari, I think you used SLUB. If so, page_cgroup's notifier callback was not
called and newly allocated page's page_cgroup wasn't allocated.
This is a fix. (notifier saw STOP_HERE flag added by slub's notifier.)
I'm now testing modified kernel, which does alloc/free page_cgroup by notifier.
(Usually, all page_cgroups are from bootmem and not freed.
so, modified a bit for test)
And I cannot reproduce panic. I think you do "real" memory hotplug other than
online/offline and saw panic caused by this.
Is this slub's behavior intentional ? page_cgroup's notifier has lower priority
than slub, now.
Thanks,
-Kame
==
notifier callback's notifier_from_errno() just works well in error
route. (It adds mask for "stop here")
Hanlder should return NOTIFY_OK in explict way.
Signed-off-by:KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
mm/page_cgroup.c | 5 ++++-
mm/slub.c | 6 ++++--
2 files changed, 8 insertions(+), 3 deletions(-)
Index: mmotm-2.6.28-Nov10/mm/slub.c
===================================================================
--- mmotm-2.6.28-Nov10.orig/mm/slub.c
+++ mmotm-2.6.28-Nov10/mm/slub.c
@@ -3220,8 +3220,10 @@ static int slab_memory_callback(struct n
case MEM_CANCEL_OFFLINE:
break;
}
-
- ret = notifier_from_errno(ret);
+ if (ret)
+ ret = notifier_from_errno(ret);
+ else
+ ret = NOTIFY_OK;
return ret;
}
Index: mmotm-2.6.28-Nov10/mm/page_cgroup.c
===================================================================
--- mmotm-2.6.28-Nov10.orig/mm/page_cgroup.c
+++ mmotm-2.6.28-Nov10/mm/page_cgroup.c
@@ -216,7 +216,10 @@ static int page_cgroup_callback(struct n
break;
}
- ret = notifier_from_errno(ret);
+ if (ret)
+ ret = notifier_from_errno(ret);
+ else
+ ret = NOTIFY_OK;
return ret;
}
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-11-13 11:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-10 21:43 2.6.28-rc4 mem_cgroup_charge_common panic Badari Pulavarty
2008-11-11 1:14 ` KAMEZAWA Hiroyuki
2008-11-11 2:09 ` KAMEZAWA Hiroyuki
2008-11-12 22:02 ` Badari Pulavarty
2008-11-13 1:09 ` KAMEZAWA Hiroyuki
2008-11-13 2:17 ` KAMEZAWA Hiroyuki
2008-11-13 18:53 ` Badari Pulavarty
2008-11-14 4:10 ` KAMEZAWA Hiroyuki
2008-11-17 21:30 ` Badari Pulavarty
2008-11-18 1:08 ` KAMEZAWA Hiroyuki
2008-11-13 11:27 ` KAMEZAWA Hiroyuki [this message]
2008-11-13 17:11 ` [BUGFIX][PATCH] memory hotplug: fix notiier chain return value (Was Re: 2.6.28-rc4 mem_cgroup_charge_common panic) Badari Pulavarty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081113202758.2f12915a.kamezawa.hiroyu@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pbadari@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox