bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@intel.com>
To: "Jakub Kicinski" <kuba@kernel.org>,
	"Björn Töpel" <bjorn.topel@gmail.com>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org,
	magnus.karlsson@intel.com, ast@kernel.org, daniel@iogearbox.net,
	maciej.fijalkowski@intel.com, sridhar.samudrala@intel.com,
	jesse.brandeburg@intel.com, qi.z.zhang@intel.com,
	edumazet@google.com, jonathan.lemon@gmail.com,
	maximmi@nvidia.com
Subject: Re: [PATCH bpf-next v2 01/10] net: introduce preferred busy-polling
Date: Mon, 16 Nov 2020 18:28:03 +0100	[thread overview]
Message-ID: <b762480b-0eac-e6a5-9bbd-34cc35b43723@intel.com> (raw)
In-Reply-To: <2997d870-09d3-748f-0673-8e2baf7be3fa@intel.com>

On 2020-11-16 17:19, Björn Töpel wrote:
> On 2020-11-16 17:04, Jakub Kicinski wrote:
>> On Mon, 16 Nov 2020 12:04:07 +0100 Björn Töpel wrote:
>>> @@ -6771,6 +6806,19 @@ static int napi_poll(struct napi_struct *n, 
>>> struct list_head *repoll)
>>>       if (likely(work < weight))
>>>           goto out_unlock;
>>> +    /* The NAPI context has more processing work, but busy-polling
>>> +     * is preferred. Exit early.
>>> +     */
>>> +    if (napi_prefer_busy_poll(n)) {
>>> +        if (napi_complete_done(n, work)) {
>>> +            /* If timeout is not set, we need to make sure
>>> +             * that the NAPI is re-scheduled.
>>> +             */
>>> +            napi_schedule(n);
>>> +        }
>>> +        goto out_unlock;
>>> +    }
>>
>> Why is this before the disabled check?
>>
> 
> This path is when the budget was exceeded (more work to be done). If the
> prefer flag is set, the napi loop is exited prematurely. We check the
> return value for napi_complete_done, to make sure that there is actually
> a TO value set.
> 
> Uhm, maybe I not following what you mean by the "disabled check".
>

Ok, too little coffee.

Yeah, maybe it would make sense to have the disabled check *before* the
"prefer"-checking.


Björn


  reply	other threads:[~2020-11-16 17:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16 11:04 [PATCH bpf-next v2 00/10] Introduce preferred busy-polling Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 01/10] net: introduce " Björn Töpel
2020-11-16 16:04   ` Jakub Kicinski
2020-11-16 16:19     ` Björn Töpel
2020-11-16 17:28       ` Björn Töpel [this message]
2020-11-16 11:04 ` [PATCH bpf-next v2 02/10] net: add SO_BUSY_POLL_BUDGET socket option Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 03/10] xsk: add support for recvmsg() Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 04/10] xsk: check need wakeup flag in sendmsg() Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 05/10] xsk: add busy-poll support for {recv,send}msg() Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 06/10] xsk: propagate napi_id to XDP socket Rx path Björn Töpel
2020-11-16 11:19   ` Tariq Toukan
2020-11-16 11:55   ` Michael S. Tsirkin
2020-11-16 12:01     ` Björn Töpel
2020-11-16 12:42       ` Michael S. Tsirkin
2020-11-16 13:24         ` Björn Töpel
2020-11-16 13:55           ` Michael S. Tsirkin
2020-11-16 17:40             ` Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 07/10] samples/bpf: use recvfrom() in xdpsock/rxdrop Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 08/10] samples/bpf: use recvfrom() in xdpsock/l2fwd Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 09/10] samples/bpf: add busy-poll support to xdpsock Björn Töpel
2020-11-16 11:04 ` [PATCH bpf-next v2 10/10] samples/bpf: add option to set the busy-poll budget Björn Töpel

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=b762480b-0eac-e6a5-9bbd-34cc35b43723@intel.com \
    --to=bjorn.topel@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=edumazet@google.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=maximmi@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=qi.z.zhang@intel.com \
    --cc=sridhar.samudrala@intel.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).