Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295466 > unrolled thread

[PATCH v2] RDS: don't pretend to use cpu notifiers

Started bySantosh Shilimkar <santosh.shilimkar@oracle.com>
First post2015-12-19 22:00 +0100
Last post2015-12-22 21:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] RDS: don't pretend to use cpu notifiers Santosh Shilimkar <santosh.shilimkar@oracle.com> - 2015-12-19 22:00 +0100
    Re: [PATCH v2] RDS: don't pretend to use cpu notifiers David Miller <davem@davemloft.net> - 2015-12-22 21:30 +0100

#1295466 — [PATCH v2] RDS: don't pretend to use cpu notifiers

FromSantosh Shilimkar <santosh.shilimkar@oracle.com>
Date2015-12-19 22:00 +0100
Subject[PATCH v2] RDS: don't pretend to use cpu notifiers
Message-ID<qHwLD-84r-3@gated-at.bofh.it>
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

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>
---

v2:
Test and Ack tag added.

 net/rds/page.c | 31 ++++++-------------------------
 1 file changed, 6 insertions(+), 25 deletions(-)

diff --git a/net/rds/page.c b/net/rds/page.c
index 9005a2c..5a14e6d 100644
--- a/net/rds/page.c
+++ b/net/rds/page.c
@@ -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);
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1297052

FromDavid Miller <davem@davemloft.net>
Date2015-12-22 21:30 +0100
Message-ID<qIBJf-aM-5@gated-at.bofh.it>
In reply to#1295466
From: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Date: Sat, 19 Dec 2015 12:55:43 -0800

> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> 
> 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>

Applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web