Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320862
b: refs/heads/master
c: c1c9518
h: refs/heads/master
v: v3
  • Loading branch information
Gavin Shan authored and Linus Torvalds committed Aug 1, 2012
1 parent 989debc commit becca78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db36a46113e101a8aa2d6ede41e78f2eaabed3f1
refs/heads/master: c1c9518331969f97ea403bac66f0fd4a85d204d5
14 changes: 1 addition & 13 deletions trunk/mm/sparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ static struct mem_section noinline __init_refok *sparse_index_alloc(int nid)

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;
Expand All @@ -88,20 +87,9 @@ static int __meminit sparse_index_init(unsigned long section_nr, int nid)
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;
out:
spin_unlock(&index_init_lock);

return ret;
}
#else /* !SPARSEMEM_EXTREME */
Expand Down

0 comments on commit becca78

Please sign in to comment.