From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>,
brouer@redhat.com
Subject: Re: Queue with wait-free enqueue, blocking dequeue, splice
Date: Tue, 21 Oct 2014 13:48:02 +0200 [thread overview]
Message-ID: <20141021134802.05104ecd@redhat.com> (raw)
In-Reply-To: <285747581.12566.1413849850921.JavaMail.zimbra@efficios.com>
On Tue, 21 Oct 2014 00:04:10 +0000 (UTC) Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote:
> > From: "Jesper Dangaard Brouer" <brouer@redhat.com>
> >
[...]
> > I can certainly use the wfcq_empty() check,
>
> Not sure why you would want to use it, considering that the dequeue
> operation implies it. If there is nothing to dequeue, we just return
> immediately. Dequeue operation does not block on empty queue. It
> just busy waits if it happen to see the queue in an intermediate
> state of the enqueue operation (which is very short, few instructions
> at most, with preemption disabled).
>
> > but I guess I need to
> > maintain a separate counter to maintain the qdisc limit, right?
> > (I would use the approximate/split counter API percpu_counter to keep
> > this scalable, and wfcq_empty() would provide an accurate empty check)
>
> Yes for split counters, not sure why you need the empty check explicitly
> in your use-case though.
In case the qdisc is empty, we avoid/bypass the enqueue + dequeue phase
and instead transmit the packet directly.
Iif the flag TCQ_F_CAN_BYPASS is set.
https://github.com/torvalds/linux/blob/master/net/core/dev.c#L2799
But I'm not 100% sure that we can set this flag on a lock-less qdisc.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2014-10-21 11:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1311316954.11157.1413631325000.JavaMail.zimbra@efficios.com>
2014-10-18 11:48 ` Queue with wait-free enqueue, blocking dequeue, splice Mathieu Desnoyers
2014-10-20 14:02 ` Jesper Dangaard Brouer
2014-10-21 0:04 ` Mathieu Desnoyers
2014-10-21 11:48 ` Jesper Dangaard Brouer [this message]
2014-10-21 12:02 ` Mathieu Desnoyers
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=20141021134802.05104ecd@redhat.com \
--to=brouer@redhat.com \
--cc=jhs@mojatatu.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=netdev@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.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).