Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
597fb188
Commit
597fb188
authored
Jan 15, 2011
by
Pekka Enberg
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'slub/hotplug' into slab/urgent
parents
38567333
04d94879
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
include/linux/memory_hotplug.h
include/linux/memory_hotplug.h
+6
-0
mm/memory_hotplug.c
mm/memory_hotplug.c
+4
-0
mm/slub.c
mm/slub.c
+2
-2
No files found.
include/linux/memory_hotplug.h
View file @
597fb188
...
...
@@ -165,6 +165,12 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
extern
void
put_page_bootmem
(
struct
page
*
page
);
#endif
/*
* Lock for memory hotplug guarantees 1) all callbacks for memory hotplug
* notifier will be called under this. 2) offline/online/add/remove memory
* will not run simultaneously.
*/
void
lock_memory_hotplug
(
void
);
void
unlock_memory_hotplug
(
void
);
...
...
mm/memory_hotplug.c
View file @
597fb188
...
...
@@ -409,6 +409,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
int
ret
;
struct
memory_notify
arg
;
lock_memory_hotplug
();
arg
.
start_pfn
=
pfn
;
arg
.
nr_pages
=
nr_pages
;
arg
.
status_change_nid
=
-
1
;
...
...
@@ -421,6 +422,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
ret
=
notifier_to_errno
(
ret
);
if
(
ret
)
{
memory_notify
(
MEM_CANCEL_ONLINE
,
&
arg
);
unlock_memory_hotplug
();
return
ret
;
}
/*
...
...
@@ -445,6 +447,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
printk
(
KERN_DEBUG
"online_pages %lx at %lx failed
\n
"
,
nr_pages
,
pfn
);
memory_notify
(
MEM_CANCEL_ONLINE
,
&
arg
);
unlock_memory_hotplug
();
return
ret
;
}
...
...
@@ -469,6 +472,7 @@ int online_pages(unsigned long pfn, unsigned long nr_pages)
if
(
onlined_pages
)
memory_notify
(
MEM_ONLINE
,
&
arg
);
unlock_memory_hotplug
();
return
0
;
}
...
...
mm/slub.c
View file @
597fb188
...
...
@@ -3797,7 +3797,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
}
}
down_read
(
&
slub_lock
);
lock_memory_hotplug
(
);
#ifdef CONFIG_SLUB_DEBUG
if
(
flags
&
SO_ALL
)
{
for_each_node_state
(
node
,
N_NORMAL_MEMORY
)
{
...
...
@@ -3838,7 +3838,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
x
+=
sprintf
(
buf
+
x
,
" N%d=%lu"
,
node
,
nodes
[
node
]);
#endif
u
p_read
(
&
slub_lock
);
u
nlock_memory_hotplug
(
);
kfree
(
nodes
);
return
x
+
sprintf
(
buf
+
x
,
"
\n
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment