netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Ingo Molnar <mingo@kernel.org>
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>,
	davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, mst@redhat.com,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH net-next 2/2] net: exit busy loop when another process is runnable
Date: Fri, 29 Aug 2014 11:08:48 +0800	[thread overview]
Message-ID: <53FFEEC0.4000304@redhat.com> (raw)
In-Reply-To: <20140822074224.GB7372@gmail.com>

On 08/22/2014 03:42 PM, Ingo Molnar wrote:
> * Jason Wang <jasowang@redhat.com> wrote:
>
>> Polling could be done by either rx busy loop in process 
>> context or NAPI in softirq. [...]
> Note that this shows another reason why it's a bad idea to 
> query nr_running directly: depending on the softirq processing 
> method, a softirq might run:
>
>  - directly in process context
>  - in an idle thread's context
>  - or in a ksoftirqd context. 
>
> 'nr_running' will have different values in these cases, causing 
> assymetries in busy-poll handling!

Current rx busy polling code only works in process context, we can add
BUG or warnings to make sure the helper was only called in process context.
>
> Another class of assymetry is when there are other softirq bits 
> pending, beyond NET_RX (or NET_TX): a nr_running check misses 
> them.

Yes, but rx busy polling only works in process context and does not
disable bh, so it may be not an issue.
> The solution I outlined in the previous mail (using a 
> sched_expected_runtime() method) would be able to avoid most of 
> these artifacts.

It only take cares the remaining runnable time for current process, this
is a good hint for sk_busy_loop_end_time() which return the maximum time
a process could do busy polling. But this is not this patch needs. We
need check the state of other runnable process in current cpu to avoid
damaging the performance of other process.
>
> Thanks,
>
> 	Ingo
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-08-29  3:08 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21  8:05 [PATCH net-next 1/2] sched: introduce nr_running_this_cpu() Jason Wang
2014-08-21  8:05 ` [PATCH net-next 2/2] net: exit busy loop when another process is runnable Jason Wang
2014-08-21  8:11   ` Michael S. Tsirkin
2014-08-22  2:53     ` Jason Wang
2014-08-21 19:03   ` Amos Kong
2014-08-22  5:01   ` Mike Galbraith
2014-08-22  7:29     ` Jason Wang
2014-08-22  7:42       ` Ingo Molnar
2014-08-29  3:08         ` Jason Wang [this message]
2014-09-01  6:39           ` Eliezer Tamir
2014-09-02  3:29             ` Jason Wang
2014-09-02  6:15               ` Eliezer Tamir
2014-09-02  7:37                 ` Jason Wang
2014-09-02  8:31                 ` Michael S. Tsirkin
2014-09-03  6:49                   ` Eliezer Tamir
2014-09-03  7:33                     ` Jason Wang
2014-09-03  9:36                       ` Peter Zijlstra
2014-09-03  9:59                         ` Michael S. Tsirkin
2014-09-03  7:51                     ` Michael S. Tsirkin
2014-09-04  6:51                       ` Eliezer Tamir
2014-08-22  7:36     ` Ingo Molnar
2014-08-22  9:08       ` Jason Wang
2014-08-22 14:16         ` Eric Dumazet
2014-08-25  2:54           ` Jason Wang
2014-08-25 13:16           ` Eliezer Tamir
2014-08-26  7:16             ` Jason Wang
2014-09-01  6:55               ` Eliezer Tamir
2014-09-02  3:35                 ` Jason Wang
2014-09-02  6:03                   ` Eliezer Tamir
2014-09-02  6:31                     ` Jason Wang
2014-09-03  6:21                       ` Eliezer Tamir
2014-09-03  6:59                         ` Jason Wang
2016-04-14  0:55                       ` Peter Zijlstra
2014-09-03  8:09       ` Michael S. Tsirkin
2016-04-11 16:31       ` Michael S. Tsirkin
2016-04-13  7:20         ` Ingo Molnar
2016-04-13 13:28         ` Peter Zijlstra
2016-04-13 13:51           ` Michael S. Tsirkin
2016-04-14  0:58             ` Peter Zijlstra
2014-09-01  9:31     ` Peter Zijlstra
2014-09-01  9:52       ` Michael S. Tsirkin
2014-09-01 10:04         ` Peter Zijlstra
2014-09-01 10:19           ` Peter Zijlstra
2014-09-02  4:03             ` Jason Wang
2014-09-02 10:24               ` Peter Zijlstra
2014-09-03  6:58                 ` Jason Wang
2014-09-03  9:30                   ` Peter Zijlstra
2014-09-01 10:22           ` Michael S. Tsirkin
2014-09-02  3:38           ` Jason Wang
2014-09-02  6:12             ` Peter Zijlstra
2014-09-02  7:19               ` Jason Wang
2014-08-21 13:52 ` [PATCH net-next 1/2] sched: introduce nr_running_this_cpu() Ingo Molnar
2014-08-22  7:27   ` Jason Wang

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=53FFEEC0.4000304@redhat.com \
    --to=jasowang@redhat.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=umgwanakikbuti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).