diff --git a/[refs] b/[refs] index a1ccc8793aa0..3a8cc0f5698c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e70260aabea3af2a84b951e75166dcebe689b88e +refs/heads/master: 86f6dae1377523689bd8468fed2f2dd180fc0560 diff --git a/trunk/mm/sparse.c b/trunk/mm/sparse.c index 5398d48c360a..08f053218ee8 100644 --- a/trunk/mm/sparse.c +++ b/trunk/mm/sparse.c @@ -249,11 +249,22 @@ static unsigned long *__kmalloc_section_usemap(void) static unsigned long *__init sparse_early_usemap_alloc(unsigned long pnum) { - unsigned long *usemap; + unsigned long *usemap, section_nr; struct mem_section *ms = __nr_to_section(pnum); int nid = sparse_early_nid(ms); + struct pglist_data *pgdat = NODE_DATA(nid); - usemap = alloc_bootmem_node(NODE_DATA(nid), usemap_size()); + /* + * Usemap's page can't be freed until freeing other sections + * which use it. And, Pgdat has same feature. + * If section A has pgdat and section B has usemap for other + * sections (includes section A), both sections can't be removed, + * because there is the dependency each other. + * To solve above issue, this collects all usemap on the same section + * which has pgdat. + */ + section_nr = pfn_to_section_nr(__pa(pgdat) >> PAGE_SHIFT); + usemap = alloc_bootmem_section(usemap_size(), section_nr); if (usemap) return usemap;