lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
-lib-$(CONFIG_SMP) += percpu_counter.o
ifneq ($(CONFIG_HAVE_DEC_LOCK),y)
lib-y += dec_and_lock.o
+++ /dev/null
-#include <linux/module.h>
-#include <linux/percpu_counter.h>
-#include <linux/sched.h>
-
-void percpu_counter_mod(struct percpu_counter *fbc, long amount)
-{
- int cpu = get_cpu();
- long count = fbc->counters[cpu].count;
-
- count += amount;
- if (count >= FBC_BATCH || count <= -FBC_BATCH) {
- spin_lock(&fbc->lock);
- fbc->count += count;
- spin_unlock(&fbc->lock);
- count = 0;
- }
- fbc->counters[cpu].count = count;
- put_cpu();
-}
-
-EXPORT_SYMBOL(percpu_counter_mod);
*/
#include <linux/mm.h>
+#include <linux/sched.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
#include <linux/mman.h>
#include <linux/module.h>
#include <linux/mm_inline.h>
#include <linux/buffer_head.h> /* for try_to_release_page() */
+#include <linux/module.h>
+#include <linux/percpu_counter.h>
#include <linux/percpu.h>
/* How many pages do we try to swap or page in/out together? */
EXPORT_SYMBOL(vm_acct_memory);
#endif
+#ifdef CONFIG_SMP
+void percpu_counter_mod(struct percpu_counter *fbc, long amount)
+{
+ int cpu = get_cpu();
+ long count = fbc->counters[cpu].count;
+
+ count += amount;
+ if (count >= FBC_BATCH || count <= -FBC_BATCH) {
+ spin_lock(&fbc->lock);
+ fbc->count += count;
+ spin_unlock(&fbc->lock);
+ count = 0;
+ }
+ fbc->counters[cpu].count = count;
+ put_cpu();
+}
+EXPORT_SYMBOL(percpu_counter_mod);
+#endif
/*
* Perform any setup for the swap system