All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] pkt_sched: Remove smp_wmb() in qdisc_watchdog()
@ 2008-12-19 11:30 Jarek Poplawski
  2008-12-19 11:41 ` Jarek Poplawski
  2008-12-23  3:44 ` [PATCH RFC] " David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Jarek Poplawski @ 2008-12-19 11:30 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, netdev

Hi,

I hope Stephen will find a minute to reconsider and/or comment this
a bit.

Thanks,
Jarek P.
---------->

While implementing a TCQ_F_THROTTLED flag there was used an smp_wmb()
in qdisc_watchdog(), but since this flag is practically used only in
sch_netem(), and since it's not even clear what reordering is avoided
here (TCQ_F_THROTTLED vs. __QDISC_STATE_SCHED?) it seems the barrier
could be safely removed.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---

 net/sched/sch_api.c   |    1 -
 net/sched/sch_netem.c |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 6bc29e8..0fc4a18 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -450,7 +450,6 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
 						 timer);
 
 	wd->qdisc->flags &= ~TCQ_F_THROTTLED;
-	smp_wmb();
 	__netif_schedule(qdisc_root(wd->qdisc));
 
 	return HRTIMER_NORESTART;
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 7e78f1c..d876b87 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -266,7 +266,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
 	struct netem_sched_data *q = qdisc_priv(sch);
 	struct sk_buff *skb;
 
-	smp_mb();
 	if (sch->flags & TCQ_F_THROTTLED)
 		return NULL;
 

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

* Re: [PATCH RFC] pkt_sched: Remove smp_wmb() in qdisc_watchdog()
  2008-12-19 11:30 [PATCH RFC] pkt_sched: Remove smp_wmb() in qdisc_watchdog() Jarek Poplawski
@ 2008-12-19 11:41 ` Jarek Poplawski
  2008-12-20  2:18   ` Stephen Hemminger
  2008-12-23  3:44 ` [PATCH RFC] " David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Jarek Poplawski @ 2008-12-19 11:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, netdev

On Fri, Dec 19, 2008 at 11:30:47AM +0000, Jarek Poplawski wrote:
...
> While implementing a TCQ_F_THROTTLED flag there was used an smp_wmb()
> in qdisc_watchdog(), but since this flag is practically used only in
> sch_netem(), and since it's not even clear what reordering is avoided

Hmm.. I forgot to mention sch_cbq(), but it doesn't use a barrier
anyway.

Jarek P.

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

* Re: [PATCH RFC] pkt_sched: Remove smp_wmb() in qdisc_watchdog()
  2008-12-19 11:41 ` Jarek Poplawski
@ 2008-12-20  2:18   ` Stephen Hemminger
  2008-12-22  7:57     ` [PATCH v2] " Jarek Poplawski
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2008-12-20  2:18 UTC (permalink / raw)
  To: Jarek Poplawski; +Cc: David Miller, netdev

On Fri, 19 Dec 2008 11:41:25 +0000
Jarek Poplawski <jarkao2@gmail.com> wrote:

> On Fri, Dec 19, 2008 at 11:30:47AM +0000, Jarek Poplawski wrote:
> ...
> > While implementing a TCQ_F_THROTTLED flag there was used an smp_wmb()
> > in qdisc_watchdog(), but since this flag is practically used only in
> > sch_netem(), and since it's not even clear what reordering is avoided
> 
> Hmm.. I forgot to mention sch_cbq(), but it doesn't use a barrier
> anyway.
> 
> Jarek P.

The barrier was copied from earlier version of tbf is unnecessary.

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

* [PATCH v2] pkt_sched: Remove smp_wmb() in qdisc_watchdog()
  2008-12-20  2:18   ` Stephen Hemminger
@ 2008-12-22  7:57     ` Jarek Poplawski
  0 siblings, 0 replies; 5+ messages in thread
From: Jarek Poplawski @ 2008-12-22  7:57 UTC (permalink / raw)
  To: David Miller; +Cc: Stephen Hemminger, netdev

On Fri, Dec 19, 2008 at 06:18:51PM -0800, Stephen Hemminger wrote:
...
> The barrier was copied from earlier version of tbf is unnecessary.

So I resend this patch with only a changelog updated

Thanks,
Jarek P.
---------->
While implementing a TCQ_F_THROTTLED flag there was used an smp_wmb()
in qdisc_watchdog(). Stephen Hemminger acknowledged the barrier was
copied from earlier version of tbf and is unnecessaray, so it's
removed here.

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
---

 net/sched/sch_api.c   |    1 -
 net/sched/sch_netem.c |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 6bc29e8..0fc4a18 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -450,7 +450,6 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
 						 timer);
 
 	wd->qdisc->flags &= ~TCQ_F_THROTTLED;
-	smp_wmb();
 	__netif_schedule(qdisc_root(wd->qdisc));
 
 	return HRTIMER_NORESTART;
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 7e78f1c..d876b87 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -266,7 +266,6 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
 	struct netem_sched_data *q = qdisc_priv(sch);
 	struct sk_buff *skb;
 
-	smp_mb();
 	if (sch->flags & TCQ_F_THROTTLED)
 		return NULL;
 

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

* Re: [PATCH RFC] pkt_sched: Remove smp_wmb() in qdisc_watchdog()
  2008-12-19 11:30 [PATCH RFC] pkt_sched: Remove smp_wmb() in qdisc_watchdog() Jarek Poplawski
  2008-12-19 11:41 ` Jarek Poplawski
@ 2008-12-23  3:44 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2008-12-23  3:44 UTC (permalink / raw)
  To: jarkao2; +Cc: shemminger, netdev

From: Jarek Poplawski <jarkao2@gmail.com>
Date: Fri, 19 Dec 2008 11:30:47 +0000

> While implementing a TCQ_F_THROTTLED flag there was used an smp_wmb()
> in qdisc_watchdog(), but since this flag is practically used only in
> sch_netem(), and since it's not even clear what reordering is avoided
> here (TCQ_F_THROTTLED vs. __QDISC_STATE_SCHED?) it seems the barrier
> could be safely removed.
> 
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>

Applied to net-next-2.6, thanks Jarek.

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

end of thread, other threads:[~2008-12-23  3:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-19 11:30 [PATCH RFC] pkt_sched: Remove smp_wmb() in qdisc_watchdog() Jarek Poplawski
2008-12-19 11:41 ` Jarek Poplawski
2008-12-20  2:18   ` Stephen Hemminger
2008-12-22  7:57     ` [PATCH v2] " Jarek Poplawski
2008-12-23  3:44 ` [PATCH RFC] " David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.