* [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node @ 2012-12-23 20:15 Sasha Levin 2012-12-23 20:15 ` [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available Sasha Levin ` (2 more replies) 0 siblings, 3 replies; 15+ messages in thread From: Sasha Levin @ 2012-12-23 20:15 UTC (permalink / raw) To: rientjes, Andrew Morton, Johannes Weiner, Michal Hocko, Gavin Shan, Sasha Levin, linux-mm, linux-kernel __alloc_bootmem_node_high() would panic if it failed allocating, so the fallback would never get reached. Switch to using __alloc_bootmem_node_high_nopanic(). Signed-off-by: Sasha Levin <sasha.levin@oracle.com> --- mm/sparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/sparse.c b/mm/sparse.c index 6b5fb76..72a0db6 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -401,7 +401,7 @@ void __init sparse_mem_maps_populate_node(struct page **map_map, } size = PAGE_ALIGN(size); - map = __alloc_bootmem_node_high(NODE_DATA(nodeid), size * map_count, + map = __alloc_bootmem_node_high_nopanic(NODE_DATA(nodeid), size * map_count, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); if (map) { for (pnum = pnum_begin; pnum < pnum_end; pnum++) { -- 1.8.0 -- 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> ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-23 20:15 [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node Sasha Levin @ 2012-12-23 20:15 ` Sasha Levin 2012-12-27 22:25 ` David Rientjes 2012-12-23 20:15 ` [PATCH 3/3] mm, sparse: don't check return value of alloc_bootmem calls Sasha Levin 2012-12-27 22:23 ` [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node David Rientjes 2 siblings, 1 reply; 15+ messages in thread From: Sasha Levin @ 2012-12-23 20:15 UTC (permalink / raw) To: rientjes, Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel Cc: Sasha Levin Bootmem alloc functions are supposed to panic if allocation fails unless a *_nopanic() function is used. However, if slab is available this is not the case currently, and the function might return a NULL. Currect it to panic on failed allocations even if slab is available. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> --- mm/bootmem.c | 9 --------- mm/nobootmem.c | 6 ------ 2 files changed, 15 deletions(-) diff --git a/mm/bootmem.c b/mm/bootmem.c index 1324cd7..198a92f 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { - if (WARN_ON_ONCE(slab_is_available())) - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); - return ___alloc_bootmem_node(pgdat, size, align, goal, 0); } @@ -775,9 +772,6 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size, #ifdef MAX_DMA32_PFN unsigned long end_pfn; - if (WARN_ON_ONCE(slab_is_available())) - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); - /* update goal according ...MAX_DMA32_PFN */ end_pfn = pgdat->node_start_pfn + pgdat->node_spanned_pages; @@ -839,9 +833,6 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { - if (WARN_ON_ONCE(slab_is_available())) - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); - return ___alloc_bootmem_node(pgdat, size, align, goal, ARCH_LOW_ADDRESS_LIMIT); } diff --git a/mm/nobootmem.c b/mm/nobootmem.c index b8294fc..7c4c608 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -371,9 +371,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { - if (WARN_ON_ONCE(slab_is_available())) - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); - return ___alloc_bootmem_node(pgdat, size, align, goal, 0); } @@ -424,9 +421,6 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal) { - if (WARN_ON_ONCE(slab_is_available())) - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); - return ___alloc_bootmem_node(pgdat, size, align, goal, ARCH_LOW_ADDRESS_LIMIT); } -- 1.8.0 -- 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> ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-23 20:15 ` [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available Sasha Levin @ 2012-12-27 22:25 ` David Rientjes 2012-12-27 22:27 ` Pekka Enberg 2012-12-27 22:40 ` Sasha Levin 0 siblings, 2 replies; 15+ messages in thread From: David Rientjes @ 2012-12-27 22:25 UTC (permalink / raw) To: Sasha Levin Cc: Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel On Sun, 23 Dec 2012, Sasha Levin wrote: > diff --git a/mm/bootmem.c b/mm/bootmem.c > index 1324cd7..198a92f 100644 > --- a/mm/bootmem.c > +++ b/mm/bootmem.c > @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, > void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, > unsigned long align, unsigned long goal) > { > - if (WARN_ON_ONCE(slab_is_available())) > - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); > - > return ___alloc_bootmem_node(pgdat, size, align, goal, 0); > } > All you're doing is removing the fallback if this happens to be called with slab_is_available(). It's still possible that the slab allocator can successfully allocate the memory, though. So it would be rather unfortunate to start panicking in a situation that used to only emit a warning. Why can't you panic only kzalloc_node() returns NULL and otherwise just return the allocated memory? -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-27 22:25 ` David Rientjes @ 2012-12-27 22:27 ` Pekka Enberg 2012-12-27 22:31 ` David Rientjes 2012-12-27 22:40 ` Sasha Levin 1 sibling, 1 reply; 15+ messages in thread From: Pekka Enberg @ 2012-12-27 22:27 UTC (permalink / raw) To: David Rientjes Cc: Sasha Levin, Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel On Sun, 23 Dec 2012, Sasha Levin wrote: >> diff --git a/mm/bootmem.c b/mm/bootmem.c >> index 1324cd7..198a92f 100644 >> --- a/mm/bootmem.c >> +++ b/mm/bootmem.c >> @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, >> void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, >> unsigned long align, unsigned long goal) >> { >> - if (WARN_ON_ONCE(slab_is_available())) >> - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); >> - >> return ___alloc_bootmem_node(pgdat, size, align, goal, 0); >> } On Fri, Dec 28, 2012 at 12:25 AM, David Rientjes <rientjes@google.com> wrote: > All you're doing is removing the fallback if this happens to be called > with slab_is_available(). It's still possible that the slab allocator can > successfully allocate the memory, though. So it would be rather > unfortunate to start panicking in a situation that used to only emit a > warning. > > Why can't you panic only kzalloc_node() returns NULL and otherwise just > return the allocated memory? I'm not sure what Sasha's patch is trying to do here but the fall-back is there simply to let the caller know it's calling the bootmem allocator *too late*. That is, the slab allocator is already up and running so you're expected to use that. Pekka -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-27 22:27 ` Pekka Enberg @ 2012-12-27 22:31 ` David Rientjes 2012-12-27 22:38 ` Pekka Enberg 0 siblings, 1 reply; 15+ messages in thread From: David Rientjes @ 2012-12-27 22:31 UTC (permalink / raw) To: Pekka Enberg Cc: Sasha Levin, Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel On Fri, 28 Dec 2012, Pekka Enberg wrote: > On Sun, 23 Dec 2012, Sasha Levin wrote: > >> diff --git a/mm/bootmem.c b/mm/bootmem.c > >> index 1324cd7..198a92f 100644 > >> --- a/mm/bootmem.c > >> +++ b/mm/bootmem.c > >> @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, > >> void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, > >> unsigned long align, unsigned long goal) > >> { > >> - if (WARN_ON_ONCE(slab_is_available())) > >> - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); > >> - > >> return ___alloc_bootmem_node(pgdat, size, align, goal, 0); > >> } > > I'm not sure what Sasha's patch is trying to do here but the fall-back > is there simply to let the caller know it's calling the bootmem > allocator *too late*. That is, the slab allocator is already up and > running so you're expected to use that. > The __alloc_bootmem_node() variant is intended to panic rather than return NULL so there are callers that do not check the return value. I'm suggesting rather than removing the fallback to the slab allocator to check the return value and panic() here if kzalloc_node() returns NULL. The __alloc_bootmem_node_nopanic() variant needs not be changed. -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-27 22:31 ` David Rientjes @ 2012-12-27 22:38 ` Pekka Enberg 0 siblings, 0 replies; 15+ messages in thread From: Pekka Enberg @ 2012-12-27 22:38 UTC (permalink / raw) To: David Rientjes Cc: Sasha Levin, Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel On Fri, Dec 28, 2012 at 12:31 AM, David Rientjes <rientjes@google.com> wrote: > On Fri, 28 Dec 2012, Pekka Enberg wrote: > >> On Sun, 23 Dec 2012, Sasha Levin wrote: >> >> diff --git a/mm/bootmem.c b/mm/bootmem.c >> >> index 1324cd7..198a92f 100644 >> >> --- a/mm/bootmem.c >> >> +++ b/mm/bootmem.c >> >> @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, >> >> void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, >> >> unsigned long align, unsigned long goal) >> >> { >> >> - if (WARN_ON_ONCE(slab_is_available())) >> >> - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); >> >> - >> >> return ___alloc_bootmem_node(pgdat, size, align, goal, 0); >> >> } >> >> I'm not sure what Sasha's patch is trying to do here but the fall-back >> is there simply to let the caller know it's calling the bootmem >> allocator *too late*. That is, the slab allocator is already up and >> running so you're expected to use that. >> > > The __alloc_bootmem_node() variant is intended to panic rather than return > NULL so there are callers that do not check the return value. I'm > suggesting rather than removing the fallback to the slab allocator to > check the return value and panic() here if kzalloc_node() returns NULL. > The __alloc_bootmem_node_nopanic() variant needs not be changed. Makes sense. Dropping the fallback completely just makes it more difficult to find early boot bugs where the bootmem allocator is called too late. -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-27 22:25 ` David Rientjes 2012-12-27 22:27 ` Pekka Enberg @ 2012-12-27 22:40 ` Sasha Levin 2012-12-27 23:04 ` David Rientjes 1 sibling, 1 reply; 15+ messages in thread From: Sasha Levin @ 2012-12-27 22:40 UTC (permalink / raw) To: David Rientjes Cc: Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel On 12/27/2012 05:25 PM, David Rientjes wrote: > On Sun, 23 Dec 2012, Sasha Levin wrote: > >> diff --git a/mm/bootmem.c b/mm/bootmem.c >> index 1324cd7..198a92f 100644 >> --- a/mm/bootmem.c >> +++ b/mm/bootmem.c >> @@ -763,9 +763,6 @@ void * __init ___alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, >> void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, >> unsigned long align, unsigned long goal) >> { >> - if (WARN_ON_ONCE(slab_is_available())) >> - return kzalloc_node(size, GFP_NOWAIT, pgdat->node_id); >> - >> return ___alloc_bootmem_node(pgdat, size, align, goal, 0); >> } >> > > All you're doing is removing the fallback if this happens to be called > with slab_is_available(). It's still possible that the slab allocator can > successfully allocate the memory, though. So it would be rather > unfortunate to start panicking in a situation that used to only emit a > warning. > > Why can't you panic only kzalloc_node() returns NULL and otherwise just > return the allocated memory? That's exactly what happens with the patch. Note that in the current upstream version there are several slab checks scattered all over. In this case for example, I'm removing it from __alloc_bootmem_node(), but the first code line of__alloc_bootmem_node_nopanic() is: if (WARN_ON_ONCE(slab_is_available())) return kzalloc(size, GFP_NOWAIT); So the current behaviour is still preserved, but the code is simplified to have only one place that allocates memory (both from the slab and from bootmem), instead of having slab allocations sprinkled all over. Thanks, Sasha -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-27 22:40 ` Sasha Levin @ 2012-12-27 23:04 ` David Rientjes 2012-12-27 23:07 ` Sasha Levin 0 siblings, 1 reply; 15+ messages in thread From: David Rientjes @ 2012-12-27 23:04 UTC (permalink / raw) To: Sasha Levin Cc: Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel On Thu, 27 Dec 2012, Sasha Levin wrote: > That's exactly what happens with the patch. Note that in the current upstream > version there are several slab checks scattered all over. > > In this case for example, I'm removing it from __alloc_bootmem_node(), but the > first code line of__alloc_bootmem_node_nopanic() is: > > if (WARN_ON_ONCE(slab_is_available())) > return kzalloc(size, GFP_NOWAIT); > You're only talking about mm/bootmem.c and not mm/nobootmem.c, and notice that __alloc_bootmem_node() does not call __alloc_bootmem_node_nopanic(), it calls ___alloc_bootmem_node_nopanic(). -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-27 23:04 ` David Rientjes @ 2012-12-27 23:07 ` Sasha Levin 2012-12-28 14:42 ` JoonSoo Kim 0 siblings, 1 reply; 15+ messages in thread From: Sasha Levin @ 2012-12-27 23:07 UTC (permalink / raw) To: David Rientjes Cc: Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Joonsoo Kim, Yinghai Lu, linux-mm, linux-kernel On 12/27/2012 06:04 PM, David Rientjes wrote: > On Thu, 27 Dec 2012, Sasha Levin wrote: > >> That's exactly what happens with the patch. Note that in the current upstream >> version there are several slab checks scattered all over. >> >> In this case for example, I'm removing it from __alloc_bootmem_node(), but the >> first code line of__alloc_bootmem_node_nopanic() is: >> >> if (WARN_ON_ONCE(slab_is_available())) >> return kzalloc(size, GFP_NOWAIT); >> > > You're only talking about mm/bootmem.c and not mm/nobootmem.c, and notice > that __alloc_bootmem_node() does not call __alloc_bootmem_node_nopanic(), > it calls ___alloc_bootmem_node_nopanic(). Holy cow, this is an underscore hell. Thanks, Sasha -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-27 23:07 ` Sasha Levin @ 2012-12-28 14:42 ` JoonSoo Kim 2012-12-28 19:16 ` Yinghai Lu 0 siblings, 1 reply; 15+ messages in thread From: JoonSoo Kim @ 2012-12-28 14:42 UTC (permalink / raw) To: Sasha Levin Cc: David Rientjes, Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, Yinghai Lu, linux-mm, linux-kernel Hello, Sasha. 2012/12/28 Sasha Levin <sasha.levin@oracle.com>: > On 12/27/2012 06:04 PM, David Rientjes wrote: >> On Thu, 27 Dec 2012, Sasha Levin wrote: >> >>> That's exactly what happens with the patch. Note that in the current upstream >>> version there are several slab checks scattered all over. >>> >>> In this case for example, I'm removing it from __alloc_bootmem_node(), but the >>> first code line of__alloc_bootmem_node_nopanic() is: >>> >>> if (WARN_ON_ONCE(slab_is_available())) >>> return kzalloc(size, GFP_NOWAIT); >>> >> >> You're only talking about mm/bootmem.c and not mm/nobootmem.c, and notice >> that __alloc_bootmem_node() does not call __alloc_bootmem_node_nopanic(), >> it calls ___alloc_bootmem_node_nopanic(). > > Holy cow, this is an underscore hell. > > > Thanks, > Sasha > I have a different idea. How about removing fallback allocation in bootmem.c completely? I don't know why it is there exactly. But, warning for 'slab_is_available()' is there for a long time. So, most people who misuse fallback allocation change their code adequately. I think that removing fallback at this time is valid. Isn't it? Fallback allocation may cause possible bug. If someone free a memory from fallback allocation, it can't be handled properly. So, IMHO, at this time, we should remove fallback allocation in bootmem.c entirely. Please let me know what I misunderstand. Thanks. -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available 2012-12-28 14:42 ` JoonSoo Kim @ 2012-12-28 19:16 ` Yinghai Lu 0 siblings, 0 replies; 15+ messages in thread From: Yinghai Lu @ 2012-12-28 19:16 UTC (permalink / raw) To: JoonSoo Kim Cc: Sasha Levin, David Rientjes, Andrew Morton, Johannes Weiner, David S. Miller, Tejun Heo, linux-mm, linux-kernel On Fri, Dec 28, 2012 at 6:42 AM, JoonSoo Kim <js1304@gmail.com> wrote: > > I have a different idea. > How about removing fallback allocation in bootmem.c completely? > I don't know why it is there exactly. > But, warning for 'slab_is_available()' is there for a long time. > So, most people who misuse fallback allocation change their code adequately. > I think that removing fallback at this time is valid. Isn't it? if you guys really want to make thing simple, please do try to help to kill mm/bootmem.c and use memblock instead. at last we could the wrapper mm/nobootmem.c. Thanks Yinghai -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 3/3] mm, sparse: don't check return value of alloc_bootmem calls 2012-12-23 20:15 [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node Sasha Levin 2012-12-23 20:15 ` [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available Sasha Levin @ 2012-12-23 20:15 ` Sasha Levin 2012-12-27 22:28 ` David Rientjes 2012-12-27 22:23 ` [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node David Rientjes 2 siblings, 1 reply; 15+ messages in thread From: Sasha Levin @ 2012-12-23 20:15 UTC (permalink / raw) To: rientjes, Andrew Morton, Johannes Weiner, Michal Hocko, Gavin Shan, Sasha Levin, linux-mm, linux-kernel There's no need to check the result of alloc_bootmem() functions since they'll panic if allocation fails. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> --- mm/sparse.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 72a0db6..949fb38 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -497,8 +497,6 @@ void __init sparse_init(void) */ size = sizeof(unsigned long *) * NR_MEM_SECTIONS; usemap_map = alloc_bootmem(size); - if (!usemap_map) - panic("can not allocate usemap_map\n"); for (pnum = 0; pnum < NR_MEM_SECTIONS; pnum++) { struct mem_section *ms; @@ -538,8 +536,6 @@ void __init sparse_init(void) #ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER size2 = sizeof(struct page *) * NR_MEM_SECTIONS; map_map = alloc_bootmem(size2); - if (!map_map) - panic("can not allocate map_map\n"); for (pnum = 0; pnum < NR_MEM_SECTIONS; pnum++) { struct mem_section *ms; -- 1.8.0 -- 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> ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 3/3] mm, sparse: don't check return value of alloc_bootmem calls 2012-12-23 20:15 ` [PATCH 3/3] mm, sparse: don't check return value of alloc_bootmem calls Sasha Levin @ 2012-12-27 22:28 ` David Rientjes 0 siblings, 0 replies; 15+ messages in thread From: David Rientjes @ 2012-12-27 22:28 UTC (permalink / raw) To: Sasha Levin Cc: Andrew Morton, Johannes Weiner, Michal Hocko, Gavin Shan, linux-mm, linux-kernel On Sun, 23 Dec 2012, Sasha Levin wrote: > There's no need to check the result of alloc_bootmem() functions since > they'll panic if allocation fails. > > Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Acked-by: David Rientjes <rientjes@google.com> -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node 2012-12-23 20:15 [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node Sasha Levin 2012-12-23 20:15 ` [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available Sasha Levin 2012-12-23 20:15 ` [PATCH 3/3] mm, sparse: don't check return value of alloc_bootmem calls Sasha Levin @ 2012-12-27 22:23 ` David Rientjes 2012-12-27 22:41 ` Sasha Levin 2 siblings, 1 reply; 15+ messages in thread From: David Rientjes @ 2012-12-27 22:23 UTC (permalink / raw) To: Sasha Levin Cc: Andrew Morton, Johannes Weiner, Michal Hocko, Gavin Shan, linux-mm, linux-kernel On Sun, 23 Dec 2012, Sasha Levin wrote: > diff --git a/mm/sparse.c b/mm/sparse.c > index 6b5fb76..72a0db6 100644 > --- a/mm/sparse.c > +++ b/mm/sparse.c > @@ -401,7 +401,7 @@ void __init sparse_mem_maps_populate_node(struct page **map_map, > } > > size = PAGE_ALIGN(size); > - map = __alloc_bootmem_node_high(NODE_DATA(nodeid), size * map_count, > + map = __alloc_bootmem_node_high_nopanic(NODE_DATA(nodeid), size * map_count, > PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); > if (map) { > for (pnum = pnum_begin; pnum < pnum_end; pnum++) { What tree is this series based on? There's no __alloc_bootmem_node_high_nopanic() either in 3.8-rc1 nor in linux-next. -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node 2012-12-27 22:23 ` [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node David Rientjes @ 2012-12-27 22:41 ` Sasha Levin 0 siblings, 0 replies; 15+ messages in thread From: Sasha Levin @ 2012-12-27 22:41 UTC (permalink / raw) To: David Rientjes Cc: Andrew Morton, Johannes Weiner, Michal Hocko, Gavin Shan, linux-mm, linux-kernel On 12/27/2012 05:23 PM, David Rientjes wrote: > On Sun, 23 Dec 2012, Sasha Levin wrote: > >> diff --git a/mm/sparse.c b/mm/sparse.c >> index 6b5fb76..72a0db6 100644 >> --- a/mm/sparse.c >> +++ b/mm/sparse.c >> @@ -401,7 +401,7 @@ void __init sparse_mem_maps_populate_node(struct page **map_map, >> } >> >> size = PAGE_ALIGN(size); >> - map = __alloc_bootmem_node_high(NODE_DATA(nodeid), size * map_count, >> + map = __alloc_bootmem_node_high_nopanic(NODE_DATA(nodeid), size * map_count, >> PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); >> if (map) { >> for (pnum = pnum_begin; pnum < pnum_end; pnum++) { > > What tree is this series based on? There's no > __alloc_bootmem_node_high_nopanic() either in 3.8-rc1 nor in linux-next. > This is me getting git-send-email wrong and forgetting the first patch that adds it. Sorry, will resend. Thanks, Sasha -- 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> ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-12-28 19:16 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-12-23 20:15 [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node Sasha Levin 2012-12-23 20:15 ` [PATCH 2/3] mm, bootmem: panic in bootmem alloc functions even if slab is available Sasha Levin 2012-12-27 22:25 ` David Rientjes 2012-12-27 22:27 ` Pekka Enberg 2012-12-27 22:31 ` David Rientjes 2012-12-27 22:38 ` Pekka Enberg 2012-12-27 22:40 ` Sasha Levin 2012-12-27 23:04 ` David Rientjes 2012-12-27 23:07 ` Sasha Levin 2012-12-28 14:42 ` JoonSoo Kim 2012-12-28 19:16 ` Yinghai Lu 2012-12-23 20:15 ` [PATCH 3/3] mm, sparse: don't check return value of alloc_bootmem calls Sasha Levin 2012-12-27 22:28 ` David Rientjes 2012-12-27 22:23 ` [PATCH 1/3] mm, sparse: allocate bootmem without panicing in sparse_mem_maps_populate_node David Rientjes 2012-12-27 22:41 ` Sasha Levin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).