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


Groups > linux.kernel > #1419530 > unrolled thread

Re: [PATCH][RT] netpoll: Always take poll_lock when doing polling

Started bySebastian Andrzej Siewior <bigeasy@linutronix.de>
First post2016-06-10 17:40 +0200
Last post2016-06-10 18:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH][RT] netpoll: Always take poll_lock when doing polling Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2016-06-10 17:40 +0200
    Re: [PATCH][RT] netpoll: Always take poll_lock when doing polling Eric Dumazet <eric.dumazet@gmail.com> - 2016-06-10 18:30 +0200

#1419530 — Re: [PATCH][RT] netpoll: Always take poll_lock when doing polling

FromSebastian Andrzej Siewior <bigeasy@linutronix.de>
Date2016-06-10 17:40 +0200
SubjectRe: [PATCH][RT] netpoll: Always take poll_lock when doing polling
Message-ID<rIwHo-6kc-5@gated-at.bofh.it>
* Steven Rostedt | 2016-05-26 19:56:41 [-0400]:

>For example:
>
>   <interrupt thread (as all interrupts on RT are threaded>
>
>   napi_schedule_prep()
>        test_and_set_bit(NAPI_STATE_SCHED, &n->state)
>
>   <preempted by higher prio task that runs softirqs in its context>
>
>   sk_busy_loop()
>
>      do {
>           rc = busy_poll()
>               ret = napi_schedule_prep()
>                    return !test_and_set_bit(NAPI_STATE_SCHED, &n->state)
>                     <returns zero because NAPI_STATE_SCHED is set>
>               if (!ret) return 0
>           <rc is zero>
>      } while (...) /* for ever */
>

No, I don't see the busyloop. while() is here:
|    while (!nonblock && skb_queue_empty(&sk->sk_receive_queue) &&
|                  !need_resched() && !busy_loop_timeout(end_time));

and this seems to be the case since v3.11 where it was introduced (but
now it moved to dev.c). So even if there is no busy_poll() and
napi_schedule_prep() returns 0 our cycles here are limited by
busy_loop_timeout().

Sebastian

[toc] | [next] | [standalone]


#1419568

FromEric Dumazet <eric.dumazet@gmail.com>
Date2016-06-10 18:30 +0200
Message-ID<rIxtL-6Us-15@gated-at.bofh.it>
In reply to#1419530
On Fri, 2016-06-10 at 17:30 +0200, Sebastian Andrzej Siewior wrote:
> * Steven Rostedt | 2016-05-26 19:56:41 [-0400]:
> 
> >For example:
> >
> >   <interrupt thread (as all interrupts on RT are threaded>
> >
> >   napi_schedule_prep()
> >        test_and_set_bit(NAPI_STATE_SCHED, &n->state)
> >
> >   <preempted by higher prio task that runs softirqs in its context>
> >
> >   sk_busy_loop()
> >
> >      do {
> >           rc = busy_poll()
> >               ret = napi_schedule_prep()
> >                    return !test_and_set_bit(NAPI_STATE_SCHED, &n->state)
> >                     <returns zero because NAPI_STATE_SCHED is set>
> >               if (!ret) return 0
> >           <rc is zero>
> >      } while (...) /* for ever */
> >
> 
> No, I don't see the busyloop. while() is here:
> |    while (!nonblock && skb_queue_empty(&sk->sk_receive_queue) &&
> |                  !need_resched() && !busy_loop_timeout(end_time));
> 
> and this seems to be the case since v3.11 where it was introduced (but
> now it moved to dev.c). So even if there is no busy_poll() and
> napi_schedule_prep() returns 0 our cycles here are limited by
> busy_loop_timeout().

Well, before linux-4.5 and commit 2a028ecb76497d ("net: allow BH
servicing in sk_busy_loop()") , sk_busy_loop() was completely blocking
BH.

Not sure it matters in your case.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web