author: Nikolay Borisov <nborisov@suse.com> 2017-07-12 14:37:51 -0700
committer: Linus Torvalds <torvalds@linux-foundation.org> 2017-07-12 16:26:05 -0700
commit: 3e8f399da490e6ac20a3cfd6aa404c9aa961a9a2
parent: c945dccc80856107f109c36a7d0e29a371b5d1b5
Commit Summary:
Diffstat:
1 file changed, 7 insertions, 0 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index 8ee7e5ec21be..3bf4a9984f4c 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -72,6 +72,13 @@ void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
}
EXPORT_SYMBOL(percpu_counter_set);
+/**
+ * This function is both preempt and irq safe. The former is due to explicit
+ * preemption disable. The latter is guaranteed by the fact that the slow path
+ * is explicitly protected by an irq-safe spinlock whereas the fast patch uses
+ * this_cpu_add which is irq-safe by definition. Hence there is no need muck
+ * with irq state before calling this one
+ */
void percpu_counter_add_batch(struct percpu_counter *fbc, s64 amount, s32 batch)
{
s64 count;