RDS: don't pretend to use cpu notifiers
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Sat, 19 Dec 2015 20:55:43 +0000 (12:55 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Dec 2015 20:23:05 +0000 (15:23 -0500)
It looks like an attempt to use CPU notifier here which was never
completed. Nobody tried to wire it up completely since 2k9. So I unwind
this code and get rid of everything not required. Oh look! 19 lines were
removed while code still does the same thing.

Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Tested-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/page.c

index 9005a2c920ee6dccc045a15a707ae64ae59d3f87..5a14e6d6a926a76a98ca71b1fae5ed6c59b5cbdb 100644 (file)
@@ -179,37 +179,18 @@ out:
 }
 EXPORT_SYMBOL_GPL(rds_page_remainder_alloc);
 
-static int rds_page_remainder_cpu_notify(struct notifier_block *self,
-                                        unsigned long action, void *hcpu)
+void rds_page_exit(void)
 {
-       struct rds_page_remainder *rem;
-       long cpu = (long)hcpu;
+       unsigned int cpu;
 
-       rem = &per_cpu(rds_page_remainders, cpu);
+       for_each_possible_cpu(cpu) {
+               struct rds_page_remainder *rem;
 
-       rdsdebug("cpu %ld action 0x%lx\n", cpu, action);
+               rem = &per_cpu(rds_page_remainders, cpu);
+               rdsdebug("cpu %u\n", cpu);
 
-       switch (action) {
-       case CPU_DEAD:
                if (rem->r_page)
                        __free_page(rem->r_page);
                rem->r_page = NULL;
-               break;
        }
-
-       return 0;
-}
-
-static struct notifier_block rds_page_remainder_nb = {
-       .notifier_call = rds_page_remainder_cpu_notify,
-};
-
-void rds_page_exit(void)
-{
-       int i;
-
-       for_each_possible_cpu(i)
-               rds_page_remainder_cpu_notify(&rds_page_remainder_nb,
-                                             (unsigned long)CPU_DEAD,
-                                             (void *)(long)i);
 }