public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba•org>
To: cascardo@linux•vnet.ibm.com
Cc: netdev@vger•kernel.org
Subject: [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue
Date: Wed, 23 Nov 2011 21:13:54 +1100	[thread overview]
Message-ID: <20111123211354.74a81a88@kryten> (raw)
In-Reply-To: <20111123211302.2a37debb@kryten>


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

  reply	other threads:[~2011-11-23 10:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 10:13 [PATCH 1/2] ehea: Reduce memory usage in buffer pools Anton Blanchard
2011-11-23 10:13 ` Anton Blanchard [this message]
2011-11-25 18:00   ` [PATCH 2/2] ehea: Use round_jiffies_relative to align workqueue David Miller
2011-11-25 18:00 ` [PATCH 1/2] ehea: Reduce memory usage in buffer pools David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111123211354.74a81a88@kryten \
    --to=anton@samba$(echo .)org \
    --cc=cascardo@linux$(echo .)vnet.ibm.com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox