linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mm/pgtable: Fix continue to preallocate pmds even if failure occurrence
@ 2013-08-15  0:31 Wanpeng Li
  2013-08-15  0:31 ` [PATCH 2/4] mm/sparse: introduce alloc_usemap_and_memmap Wanpeng Li
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Wanpeng Li @ 2013-08-15  0:31 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Rik van Riel, Dave Hansen, Fengguang Wu, Joonsoo Kim,
	Johannes Weiner, Tejun Heo, Yasuaki Ishimatsu, David Rientjes,
	KOSAKI Motohiro, Jiri Kosina, linux-mm, linux-kernel, Wanpeng Li

preallocate_pmds will continue to preallocate pmds even if failure 
occurrence, and then free all the preallocate pmds if there is 
failure, this patch fix it by stop preallocate if failure occurrence
and go to free path.

Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
---
 arch/x86/mm/pgtable.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index dfa537a..ad3397a 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -200,8 +200,10 @@ static int preallocate_pmds(pmd_t *pmds[])
 
 	for(i = 0; i < PREALLOCATED_PMDS; i++) {
 		pmd_t *pmd = (pmd_t *)__get_free_page(PGALLOC_GFP);
-		if (pmd == NULL)
+		if (pmd == NULL) {
 			failed = true;
+			break;
+		}
 		pmds[i] = pmd;
 	}
 
-- 
1.8.1.2

--
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] 13+ messages in thread

end of thread, other threads:[~2013-08-16  0:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15  0:31 [PATCH 1/4] mm/pgtable: Fix continue to preallocate pmds even if failure occurrence Wanpeng Li
2013-08-15  0:31 ` [PATCH 2/4] mm/sparse: introduce alloc_usemap_and_memmap Wanpeng Li
2013-08-15 18:03   ` Dave Hansen
2013-08-16  0:08     ` Wanpeng Li
2013-08-16  0:08     ` Wanpeng Li
2013-08-15  0:31 ` [PATCH 3/4] mm/writeback: make writeback_inodes_wb static Wanpeng Li
2013-08-15  0:31 ` [PATCH 4/4] mm/vmalloc: use wrapper function get_vm_area_size to caculate size of vm area Wanpeng Li
2013-08-15 18:07   ` Dave Hansen
2013-08-15 23:49     ` Wanpeng Li
2013-08-15 23:49     ` Wanpeng Li
2013-08-15 17:55 ` [PATCH 1/4] mm/pgtable: Fix continue to preallocate pmds even if failure occurrence Dave Hansen
2013-08-15 23:47   ` Wanpeng Li
2013-08-15 23:47   ` Wanpeng Li

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).