Skip to content

Commit 60baa15

Browse files
cfd-36Linus Torvalds
authored andcommitted
[PATCH] uml: memory hotplug cleanups
Change memory hotplug to use GFP_NOWAIT instead of GFP_ATOMIC, so that it will grab memory without sleeping, but doesn't try to use the emergency pools. A small list initialization suggested by Daniel Phillips - don't initialize lists which are just about to be list_add-ed. Signed-off-by: Jeff Dike <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 7b04d71 commit 60baa15

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/um/drivers/mconsole_kern.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static irqreturn_t mconsole_interrupt(int irq, void *dev_id,
8787
if(req.cmd->context == MCONSOLE_INTR)
8888
(*req.cmd->handler)(&req);
8989
else {
90-
new = kmalloc(sizeof(*new), GFP_ATOMIC);
90+
new = kmalloc(sizeof(*new), GFP_NOWAIT);
9191
if(new == NULL)
9292
mconsole_reply(&req, "Out of memory", 1, 0);
9393
else {
@@ -415,7 +415,6 @@ static int mem_config(char *str)
415415

416416
unplugged = page_address(page);
417417
if(unplug_index == UNPLUGGED_PER_PAGE){
418-
INIT_LIST_HEAD(&unplugged->list);
419418
list_add(&unplugged->list, &unplugged_pages);
420419
unplug_index = 0;
421420
}
@@ -655,7 +654,6 @@ static void with_console(struct mc_request *req, void (*proc)(void *),
655654
struct mconsole_entry entry;
656655
unsigned long flags;
657656

658-
INIT_LIST_HEAD(&entry.list);
659657
entry.request = *req;
660658
list_add(&entry.list, &clients);
661659
spin_lock_irqsave(&console_lock, flags);

0 commit comments

Comments
 (0)