projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
brcmfmac: streamline SDIO read frame routine
[cascardo/linux.git]
/
mm
/
sparse.c
diff --git
a/mm/sparse.c
b/mm/sparse.c
index
c7bb952
..
fac95f2
100644
(file)
--- a/
mm/sparse.c
+++ b/
mm/sparse.c
@@
-65,21
+65,18
@@
static struct mem_section noinline __init_refok *sparse_index_alloc(int nid)
if (slab_is_available()) {
if (node_state(nid, N_HIGH_MEMORY))
if (slab_is_available()) {
if (node_state(nid, N_HIGH_MEMORY))
- section = k
m
alloc_node(array_size, GFP_KERNEL, nid);
+ section = k
z
alloc_node(array_size, GFP_KERNEL, nid);
else
else
- section = k
m
alloc(array_size, GFP_KERNEL);
- } else
+ section = k
z
alloc(array_size, GFP_KERNEL);
+ } else
{
section = alloc_bootmem_node(NODE_DATA(nid), array_size);
section = alloc_bootmem_node(NODE_DATA(nid), array_size);
-
- if (section)
- memset(section, 0, array_size);
+ }
return section;
}
static int __meminit sparse_index_init(unsigned long section_nr, int nid)
{
return section;
}
static int __meminit sparse_index_init(unsigned long section_nr, int nid)
{
- static DEFINE_SPINLOCK(index_init_lock);
unsigned long root = SECTION_NR_TO_ROOT(section_nr);
struct mem_section *section;
int ret = 0;
unsigned long root = SECTION_NR_TO_ROOT(section_nr);
struct mem_section *section;
int ret = 0;
@@
-90,20
+87,9
@@
static int __meminit sparse_index_init(unsigned long section_nr, int nid)
section = sparse_index_alloc(nid);
if (!section)
return -ENOMEM;
section = sparse_index_alloc(nid);
if (!section)
return -ENOMEM;
- /*
- * This lock keeps two different sections from
- * reallocating for the same index
- */
- spin_lock(&index_init_lock);
-
- if (mem_section[root]) {
- ret = -EEXIST;
- goto out;
- }
mem_section[root] = section;
mem_section[root] = section;
-out:
- spin_unlock(&index_init_lock);
+
return ret;
}
#else /* !SPARSEMEM_EXTREME */
return ret;
}
#else /* !SPARSEMEM_EXTREME */
@@
-132,6
+118,8
@@
int __section_nr(struct mem_section* ms)
break;
}
break;
}
+ VM_BUG_ON(root_nr == NR_SECTION_ROOTS);
+
return (root_nr * SECTIONS_PER_ROOT) + (ms - root);
}
return (root_nr * SECTIONS_PER_ROOT) + (ms - root);
}
@@
-493,6
+481,9
@@
void __init sparse_init(void)
struct page **map_map;
#endif
struct page **map_map;
#endif
+ /* Setup pageblock_order for HUGETLB_PAGE_SIZE_VARIABLE */
+ set_pageblock_order();
+
/*
* map is using big page (aka 2M in x86 64 bit)
* usemap is less one page (aka 24 bytes)
/*
* map is using big page (aka 2M in x86 64 bit)
* usemap is less one page (aka 24 bytes)