Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-22 Thread Yasuaki Ishimatsu
2013/04/19 23:30, Toshi Kani wrote: On Fri, 2013-04-19 at 17:09 +0900, Yasuaki Ishimatsu wrote: Hi Toshi, 2013/04/19 8:33, Yasuaki Ishimatsu wrote: Hi Toshi, 2013/04/18 23:23, Toshi Kani wrote: On Thu, 2013-04-18 at 17:36 +0900, Yasuaki Ishimatsu wrote: When hot removing memory presented at

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-19 Thread Toshi Kani
On Fri, 2013-04-19 at 17:09 +0900, Yasuaki Ishimatsu wrote: > Hi Toshi, > > 2013/04/19 8:33, Yasuaki Ishimatsu wrote: > > Hi Toshi, > > > > 2013/04/18 23:23, Toshi Kani wrote: > >> On Thu, 2013-04-18 at 17:36 +0900, Yasuaki Ishimatsu wrote: > >>> When hot removing memory presented at boot time, fo

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-19 Thread Yasuaki Ishimatsu
Hi Toshi, 2013/04/19 8:33, Yasuaki Ishimatsu wrote: Hi Toshi, 2013/04/18 23:23, Toshi Kani wrote: On Thu, 2013-04-18 at 17:36 +0900, Yasuaki Ishimatsu wrote: When hot removing memory presented at boot time, following messages are shown: : diff --git a/kernel/resource.c b/kernel/resource.c

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-18 Thread Yasuaki Ishimatsu
2013/04/19 8:28, Toshi Kani wrote: On Fri, 2013-04-19 at 08:33 +0900, Yasuaki Ishimatsu wrote: : +static struct resource *get_resource(gfp_t flags) +{ + struct resource *res = NULL; + + spin_lock(&bootmem_resource_lock); + if (bootmem_resource.sibling) { + res

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-18 Thread Toshi Kani
On Fri, 2013-04-19 at 08:33 +0900, Yasuaki Ishimatsu wrote: : > > > >> +static struct resource *get_resource(gfp_t flags) > >> +{ > >> + struct resource *res = NULL; > >> + > >> + spin_lock(&bootmem_resource_lock); > >> + if (bootmem_resource.sibling) { > >> + res = bootmem_resource.si

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-18 Thread Yasuaki Ishimatsu
Hi Toshi, 2013/04/18 23:23, Toshi Kani wrote: On Thu, 2013-04-18 at 17:36 +0900, Yasuaki Ishimatsu wrote: When hot removing memory presented at boot time, following messages are shown: : diff --git a/kernel/resource.c b/kernel/resource.c index 4aef886..637e8d2 100644 --- a/kernel/resource.c

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-18 Thread Yasuaki Ishimatsu
2013/04/18 22:42, Johannes Weiner wrote: On Thu, Apr 18, 2013 at 05:36:12PM +0900, Yasuaki Ishimatsu wrote: @@ -151,6 +162,39 @@ __initcall(ioresources_init); #endif /* CONFIG_PROC_FS */ +static void free_resource(struct resource *res) +{ + if (!res) + return; + + i

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-18 Thread Toshi Kani
On Thu, 2013-04-18 at 17:36 +0900, Yasuaki Ishimatsu wrote: > When hot removing memory presented at boot time, following messages are shown: : > diff --git a/kernel/resource.c b/kernel/resource.c > index 4aef886..637e8d2 100644 > --- a/kernel/resource.c > +++ b/kernel/resource.c > @@ -21,6 +21,7 @

Re: [Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-18 Thread Johannes Weiner
On Thu, Apr 18, 2013 at 05:36:12PM +0900, Yasuaki Ishimatsu wrote: > @@ -151,6 +162,39 @@ __initcall(ioresources_init); > > #endif /* CONFIG_PROC_FS */ > > +static void free_resource(struct resource *res) > +{ > + if (!res) > + return; > + > + if (PageSlab(virt_to_head_page

[Bug fix PATCH v4] Reusing a resource structure allocated by bootmem

2013-04-18 Thread Yasuaki Ishimatsu
When hot removing memory presented at boot time, following messages are shown: [ 296.867031] [ cut here ] [ 296.922273] kernel BUG at mm/slub.c:3409! [ 296.970229] invalid opcode: [#1] SMP [ 297.019453] Modules linked in: ebtable_nat ebtables xt_CHECKSUM iptable_m