projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
memcg: Simplify mem_cgroup_force_empty_list error handling
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
lib
/
percpu_counter.c
diff --git
a/lib/percpu_counter.c
b/lib/percpu_counter.c
index
f8a3f1a
..
ba6085d
100644
(file)
--- a/
lib/percpu_counter.c
+++ b/
lib/percpu_counter.c
@@
-12,7
+12,7
@@
#ifdef CONFIG_HOTPLUG_CPU
static LIST_HEAD(percpu_counters);
#ifdef CONFIG_HOTPLUG_CPU
static LIST_HEAD(percpu_counters);
-static DEFINE_
MUTEX
(percpu_counters_lock);
+static DEFINE_
SPINLOCK
(percpu_counters_lock);
#endif
#ifdef CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER
#endif
#ifdef CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER
@@
-123,9
+123,9
@@
int __percpu_counter_init(struct percpu_counter *fbc, s64 amount,
#ifdef CONFIG_HOTPLUG_CPU
INIT_LIST_HEAD(&fbc->list);
#ifdef CONFIG_HOTPLUG_CPU
INIT_LIST_HEAD(&fbc->list);
-
mutex
_lock(&percpu_counters_lock);
+
spin
_lock(&percpu_counters_lock);
list_add(&fbc->list, &percpu_counters);
list_add(&fbc->list, &percpu_counters);
-
mutex
_unlock(&percpu_counters_lock);
+
spin
_unlock(&percpu_counters_lock);
#endif
return 0;
}
#endif
return 0;
}
@@
-139,9
+139,9
@@
void percpu_counter_destroy(struct percpu_counter *fbc)
debug_percpu_counter_deactivate(fbc);
#ifdef CONFIG_HOTPLUG_CPU
debug_percpu_counter_deactivate(fbc);
#ifdef CONFIG_HOTPLUG_CPU
-
mutex
_lock(&percpu_counters_lock);
+
spin
_lock(&percpu_counters_lock);
list_del(&fbc->list);
list_del(&fbc->list);
-
mutex
_unlock(&percpu_counters_lock);
+
spin
_unlock(&percpu_counters_lock);
#endif
free_percpu(fbc->counters);
fbc->counters = NULL;
#endif
free_percpu(fbc->counters);
fbc->counters = NULL;
@@
-170,7
+170,7
@@
static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
return NOTIFY_OK;
cpu = (unsigned long)hcpu;
return NOTIFY_OK;
cpu = (unsigned long)hcpu;
-
mutex
_lock(&percpu_counters_lock);
+
spin
_lock(&percpu_counters_lock);
list_for_each_entry(fbc, &percpu_counters, list) {
s32 *pcount;
unsigned long flags;
list_for_each_entry(fbc, &percpu_counters, list) {
s32 *pcount;
unsigned long flags;
@@
-181,7
+181,7
@@
static int __cpuinit percpu_counter_hotcpu_callback(struct notifier_block *nb,
*pcount = 0;
raw_spin_unlock_irqrestore(&fbc->lock, flags);
}
*pcount = 0;
raw_spin_unlock_irqrestore(&fbc->lock, flags);
}
-
mutex
_unlock(&percpu_counters_lock);
+
spin
_unlock(&percpu_counters_lock);
#endif
return NOTIFY_OK;
}
#endif
return NOTIFY_OK;
}