* [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
@ 2009-08-22 0:03 David Miller
2009-08-22 8:41 ` Thomas Gleixner
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: David Miller @ 2009-08-22 0:03 UTC (permalink / raw)
To: netdev; +Cc: tglx
None of this stuff should execute in hw IRQ context, therefore
use a tasklet_hrtimer so that it runs in softirq context.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
include/net/pkt_sched.h | 4 ++--
net/sched/sch_api.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 82a3191..7eafb8d 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -61,8 +61,8 @@ psched_tdiff_bounded(psched_time_t tv1, psched_time_t tv2, psched_time_t bound)
}
struct qdisc_watchdog {
- struct hrtimer timer;
- struct Qdisc *qdisc;
+ struct tasklet_hrtimer timer;
+ struct Qdisc *qdisc;
};
extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 24d17ce..e1c2bf7 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -468,8 +468,8 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc)
{
- hrtimer_init(&wd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
- wd->timer.function = qdisc_watchdog;
+ tasklet_hrtimer_init(&wd->timer, qdisc_watchdog,
+ CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
wd->qdisc = qdisc;
}
EXPORT_SYMBOL(qdisc_watchdog_init);
@@ -485,13 +485,13 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
wd->qdisc->flags |= TCQ_F_THROTTLED;
time = ktime_set(0, 0);
time = ktime_add_ns(time, PSCHED_TICKS2NS(expires));
- hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
+ tasklet_hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
}
EXPORT_SYMBOL(qdisc_watchdog_schedule);
void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
{
- hrtimer_cancel(&wd->timer);
+ tasklet_hrtimer_cancel(&wd->timer);
wd->qdisc->flags &= ~TCQ_F_THROTTLED;
}
EXPORT_SYMBOL(qdisc_watchdog_cancel);
--
1.6.3.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
2009-08-22 0:03 [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer David Miller
@ 2009-08-22 8:41 ` Thomas Gleixner
2009-08-23 1:08 ` David Miller
2009-08-22 12:04 ` Jarek Poplawski
2009-08-27 8:36 ` Jarek Poplawski
2 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2009-08-22 8:41 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Fri, 21 Aug 2009, David Miller wrote:
>
> None of this stuff should execute in hw IRQ context, therefore
> use a tasklet_hrtimer so that it runs in softirq context.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
2009-08-22 8:41 ` Thomas Gleixner
@ 2009-08-23 1:08 ` David Miller
0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-08-23 1:08 UTC (permalink / raw)
To: tglx; +Cc: netdev
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sat, 22 Aug 2009 10:41:18 +0200 (CEST)
> On Fri, 21 Aug 2009, David Miller wrote:
>
>>
>> None of this stuff should execute in hw IRQ context, therefore
>> use a tasklet_hrtimer so that it runs in softirq context.
>>
>> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> Acked-by: Thomas Gleixner <tglx@linutronix.de>
Thanks for reviewing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
2009-08-22 0:03 [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer David Miller
2009-08-22 8:41 ` Thomas Gleixner
@ 2009-08-22 12:04 ` Jarek Poplawski
2009-08-23 0:54 ` David Miller
2009-08-27 8:36 ` Jarek Poplawski
2 siblings, 1 reply; 7+ messages in thread
From: Jarek Poplawski @ 2009-08-22 12:04 UTC (permalink / raw)
To: David Miller; +Cc: netdev, tglx
David Miller wrote, On 08/22/2009 02:03 AM:
> None of this stuff should execute in hw IRQ context, therefore
> use a tasklet_hrtimer so that it runs in softirq context.
Do you mean __netif_schedule()? Could you explain it more?
Thanks,
Jarek P.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
> include/net/pkt_sched.h | 4 ++--
> net/sched/sch_api.c | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
> index 82a3191..7eafb8d 100644
> --- a/include/net/pkt_sched.h
> +++ b/include/net/pkt_sched.h
> @@ -61,8 +61,8 @@ psched_tdiff_bounded(psched_time_t tv1, psched_time_t tv2, psched_time_t bound)
> }
>
> struct qdisc_watchdog {
> - struct hrtimer timer;
> - struct Qdisc *qdisc;
> + struct tasklet_hrtimer timer;
> + struct Qdisc *qdisc;
> };
>
> extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index 24d17ce..e1c2bf7 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -468,8 +468,8 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
>
> void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc)
> {
> - hrtimer_init(&wd->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
> - wd->timer.function = qdisc_watchdog;
> + tasklet_hrtimer_init(&wd->timer, qdisc_watchdog,
> + CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
> wd->qdisc = qdisc;
> }
> EXPORT_SYMBOL(qdisc_watchdog_init);
> @@ -485,13 +485,13 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
> wd->qdisc->flags |= TCQ_F_THROTTLED;
> time = ktime_set(0, 0);
> time = ktime_add_ns(time, PSCHED_TICKS2NS(expires));
> - hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
> + tasklet_hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
> }
> EXPORT_SYMBOL(qdisc_watchdog_schedule);
>
> void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
> {
> - hrtimer_cancel(&wd->timer);
> + tasklet_hrtimer_cancel(&wd->timer);
> wd->qdisc->flags &= ~TCQ_F_THROTTLED;
> }
> EXPORT_SYMBOL(qdisc_watchdog_cancel);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
2009-08-22 12:04 ` Jarek Poplawski
@ 2009-08-23 0:54 ` David Miller
0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-08-23 0:54 UTC (permalink / raw)
To: jarkao2; +Cc: netdev, tglx
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Sat, 22 Aug 2009 14:04:31 +0200
> David Miller wrote, On 08/22/2009 02:03 AM:
>
>> None of this stuff should execute in hw IRQ context, therefore
>> use a tasklet_hrtimer so that it runs in softirq context.
>
> Do you mean __netif_schedule()?
No, that works fine from HW irq context.
> Could you explain it more?
It's that throttled flag bit setting. It's still unsafe but at least
we're in a position now to use softirq locking or atomic bitops to
maintain it properly.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
2009-08-22 0:03 [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer David Miller
2009-08-22 8:41 ` Thomas Gleixner
2009-08-22 12:04 ` Jarek Poplawski
@ 2009-08-27 8:36 ` Jarek Poplawski
2009-09-01 22:49 ` David Miller
2 siblings, 1 reply; 7+ messages in thread
From: Jarek Poplawski @ 2009-08-27 8:36 UTC (permalink / raw)
To: David Miller; +Cc: netdev, tglx
On 22-08-2009 02:03, David Miller wrote:
> None of this stuff should execute in hw IRQ context, therefore
> use a tasklet_hrtimer so that it runs in softirq context.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
...
> void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
> {
> - hrtimer_cancel(&wd->timer);
> + tasklet_hrtimer_cancel(&wd->timer);
> wd->qdisc->flags &= ~TCQ_F_THROTTLED;
> }
> EXPORT_SYMBOL(qdisc_watchdog_cancel);
I've had a second look at it and I wonder why it's not reported, but
since qdisc_watchdog_cancel is run in qdisc_reset with BHs disabled
it seems there should be (at least) a warning triggered in
tasklet_kill on positive in_interrupt test (unless I miss something,
but can't test it now).
Jarek P.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
2009-08-27 8:36 ` Jarek Poplawski
@ 2009-09-01 22:49 ` David Miller
0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-09-01 22:49 UTC (permalink / raw)
To: jarkao2; +Cc: netdev, tglx
From: Jarek Poplawski <jarkao2@gmail.com>
Date: Thu, 27 Aug 2009 08:36:41 +0000
> On 22-08-2009 02:03, David Miller wrote:
>> None of this stuff should execute in hw IRQ context, therefore
>> use a tasklet_hrtimer so that it runs in softirq context.
>>
>> Signed-off-by: David S. Miller <davem@davemloft.net>
>> ---
> ...
>> void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
>> {
>> - hrtimer_cancel(&wd->timer);
>> + tasklet_hrtimer_cancel(&wd->timer);
>> wd->qdisc->flags &= ~TCQ_F_THROTTLED;
>> }
>> EXPORT_SYMBOL(qdisc_watchdog_cancel);
>
> I've had a second look at it and I wonder why it's not reported, but
> since qdisc_watchdog_cancel is run in qdisc_reset with BHs disabled
> it seems there should be (at least) a warning triggered in
> tasklet_kill on positive in_interrupt test (unless I miss something,
> but can't test it now).
There are a lot of unknowns about this stuff.
It's very likely I'm going to simply revert these two patches
and try to work on these issues in net-next-2.6 instead.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-09-01 22:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-22 0:03 [PATCH 1/2]: pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer David Miller
2009-08-22 8:41 ` Thomas Gleixner
2009-08-23 1:08 ` David Miller
2009-08-22 12:04 ` Jarek Poplawski
2009-08-23 0:54 ` David Miller
2009-08-27 8:36 ` Jarek Poplawski
2009-09-01 22:49 ` 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).