netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ehea: Reduce memory usage in buffer pools
@ 2011-11-23 10:13 Anton Blanchard
  2011-11-23 10:13 ` [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue Anton Blanchard
  2011-11-25 18:00 ` [PATCH 1/2] ehea: Reduce memory usage in buffer pools David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Anton Blanchard @ 2011-11-23 10:13 UTC (permalink / raw)
  To: cascardo; +Cc: netdev


Now that we enable multiqueue by default the ehea driver is using
quite a lot of memory for its buffer pools. With 4 queues we
consume 64MB in the jumbo packet ring, 16MB in the medium packet
ring and 16MB in the tiny packet ring.

We should only fill the jumbo ring once the MTU is increased but
for now halve it's size so it consumes 32MB. Also reduce the tiny
packet ring, with 4 queues we had 16k entries which is overkill.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-build/drivers/net/ethernet/ibm/ehea/ehea.h
===================================================================
--- linux-build.orig/drivers/net/ethernet/ibm/ehea/ehea.h	2011-11-15 11:35:21.703449412 +1100
+++ linux-build/drivers/net/ethernet/ibm/ehea/ehea.h	2011-11-15 11:48:56.461767694 +1100
@@ -61,9 +61,9 @@
 #ifdef EHEA_SMALL_QUEUES
 #define EHEA_MAX_CQE_COUNT      1023
 #define EHEA_DEF_ENTRIES_SQ     1023
-#define EHEA_DEF_ENTRIES_RQ1    4095
+#define EHEA_DEF_ENTRIES_RQ1    1023
 #define EHEA_DEF_ENTRIES_RQ2    1023
-#define EHEA_DEF_ENTRIES_RQ3    1023
+#define EHEA_DEF_ENTRIES_RQ3    511
 #else
 #define EHEA_MAX_CQE_COUNT      4080
 #define EHEA_DEF_ENTRIES_SQ     4080

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue
  2011-11-23 10:13 [PATCH 1/2] ehea: Reduce memory usage in buffer pools Anton Blanchard
@ 2011-11-23 10:13 ` Anton Blanchard
  2011-11-25 18:00   ` David Miller
  2011-11-25 18:00 ` [PATCH 1/2] ehea: Reduce memory usage in buffer pools David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2011-11-23 10:13 UTC (permalink / raw)
  To: cascardo; +Cc: netdev


Use round_jiffies_relative to align the ehea workqueue and avoid
extra wakeups.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: linux-build/drivers/net/ethernet/ibm/ehea/ehea_main.c
===================================================================
--- linux-build.orig/drivers/net/ethernet/ibm/ehea/ehea_main.c	2011-11-23 16:04:23.941615040 +1100
+++ linux-build/drivers/net/ethernet/ibm/ehea/ehea_main.c	2011-11-23 16:04:55.654208250 +1100
@@ -371,7 +371,8 @@ static void ehea_update_stats(struct wor
 out_herr:
 	free_page((unsigned long)cb2);
 resched:
-	schedule_delayed_work(&port->stats_work, msecs_to_jiffies(1000));
+	schedule_delayed_work(&port->stats_work,
+			      round_jiffies_relative(msecs_to_jiffies(1000)));
 }
 
 static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes)
@@ -2434,7 +2435,8 @@ static int ehea_open(struct net_device *
 	}
 
 	mutex_unlock(&port->port_lock);
-	schedule_delayed_work(&port->stats_work, msecs_to_jiffies(1000));
+	schedule_delayed_work(&port->stats_work,
+			      round_jiffies_relative(msecs_to_jiffies(1000)));
 
 	return ret;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] ehea: Reduce memory usage in buffer pools
  2011-11-23 10:13 [PATCH 1/2] ehea: Reduce memory usage in buffer pools Anton Blanchard
  2011-11-23 10:13 ` [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue Anton Blanchard
@ 2011-11-25 18:00 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2011-11-25 18:00 UTC (permalink / raw)
  To: anton; +Cc: cascardo, netdev

From: Anton Blanchard <anton@samba.org>
Date: Wed, 23 Nov 2011 21:13:02 +1100

> 
> Now that we enable multiqueue by default the ehea driver is using
> quite a lot of memory for its buffer pools. With 4 queues we
> consume 64MB in the jumbo packet ring, 16MB in the medium packet
> ring and 16MB in the tiny packet ring.
> 
> We should only fill the jumbo ring once the MTU is increased but
> for now halve it's size so it consumes 32MB. Also reduce the tiny
> packet ring, with 4 queues we had 16k entries which is overkill.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue
  2011-11-23 10:13 ` [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue Anton Blanchard
@ 2011-11-25 18:00   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-11-25 18:00 UTC (permalink / raw)
  To: anton; +Cc: cascardo, netdev

From: Anton Blanchard <anton@samba.org>
Date: Wed, 23 Nov 2011 21:13:54 +1100

> 
> Use round_jiffies_relative to align the ehea workqueue and avoid
> extra wakeups.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-25 18:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 10:13 [PATCH 1/2] ehea: Reduce memory usage in buffer pools Anton Blanchard
2011-11-23 10:13 ` [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue Anton Blanchard
2011-11-25 18:00   ` David Miller
2011-11-25 18:00 ` [PATCH 1/2] ehea: Reduce memory usage in buffer pools David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).