Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100530
b: refs/heads/master
c: 2f1dafe
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Paalanen authored and Thomas Gleixner committed May 23, 2008
1 parent 425206b commit 3522ccd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 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: 107bad8bef5ab2c3a3bff7648c18c9dc3abdc13b
refs/heads/master: 2f1dafe50cc4e58a239fd81bd47f87f32042a1ee
18 changes: 9 additions & 9 deletions trunk/arch/x86/kernel/alternative.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/kprobes.h>
#include <linux/mm.h>
Expand Down Expand Up @@ -279,7 +279,7 @@ struct smp_alt_module {
struct list_head next;
};
static LIST_HEAD(smp_alt_modules);
static DEFINE_SPINLOCK(smp_alt);
static DEFINE_MUTEX(smp_alt);
static int smp_mode = 1; /* protected by smp_alt */

void alternatives_smp_module_add(struct module *mod, char *name,
Expand Down Expand Up @@ -312,12 +312,12 @@ void alternatives_smp_module_add(struct module *mod, char *name,
__func__, smp->locks, smp->locks_end,
smp->text, smp->text_end, smp->name);

spin_lock(&smp_alt);
mutex_lock(&smp_alt);
list_add_tail(&smp->next, &smp_alt_modules);
if (boot_cpu_has(X86_FEATURE_UP))
alternatives_smp_unlock(smp->locks, smp->locks_end,
smp->text, smp->text_end);
spin_unlock(&smp_alt);
mutex_unlock(&smp_alt);
}

void alternatives_smp_module_del(struct module *mod)
Expand All @@ -327,17 +327,17 @@ void alternatives_smp_module_del(struct module *mod)
if (smp_alt_once || noreplace_smp)
return;

spin_lock(&smp_alt);
mutex_lock(&smp_alt);
list_for_each_entry(item, &smp_alt_modules, next) {
if (mod != item->mod)
continue;
list_del(&item->next);
spin_unlock(&smp_alt);
mutex_unlock(&smp_alt);
DPRINTK("%s: %s\n", __func__, item->name);
kfree(item);
return;
}
spin_unlock(&smp_alt);
mutex_unlock(&smp_alt);
}

void alternatives_smp_switch(int smp)
Expand All @@ -359,7 +359,7 @@ void alternatives_smp_switch(int smp)
return;
BUG_ON(!smp && (num_online_cpus() > 1));

spin_lock(&smp_alt);
mutex_lock(&smp_alt);

/*
* Avoid unnecessary switches because it forces JIT based VMs to
Expand All @@ -383,7 +383,7 @@ void alternatives_smp_switch(int smp)
mod->text, mod->text_end);
}
smp_mode = smp;
spin_unlock(&smp_alt);
mutex_unlock(&smp_alt);
}

#endif
Expand Down

0 comments on commit 3522ccd

Please sign in to comment.