From: John Fastabend <john.fastabend@gmail•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: xiyou.wangcong@gmail•com, jhs@mojatatu•com,
alexei.starovoitov@gmail•com, brouer@redhat•com,
john.r.fastabend@intel•com, netdev@vger•kernel.org,
davem@davemloft•net
Subject: Re: [RFC PATCH 01/13] net: sched: allow qdiscs to handle locking
Date: Wed, 17 Aug 2016 15:48:50 -0700 [thread overview]
Message-ID: <57B4E9D2.1090302@gmail.com> (raw)
In-Reply-To: <1471473242.29842.45.camel@edumazet-glaptop3.roam.corp.google.com>
On 16-08-17 03:34 PM, Eric Dumazet wrote:
> On Wed, 2016-08-17 at 12:33 -0700, John Fastabend wrote:
>
>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index 4ce07dc..5db395d 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -3076,6 +3076,26 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
>> int rc;
>>
>> qdisc_calculate_pkt_len(skb, q);
>> +
>> + if (q->flags & TCQ_F_NOLOCK) {
>> + if (unlikely(test_bit(__QDISC_STATE_DEACTIVATED, &q->state))) {
>> + __qdisc_drop(skb, &to_free);
>> + rc = NET_XMIT_DROP;
>> + } else if ((q->flags & TCQ_F_CAN_BYPASS) && !qdisc_qlen(q)) {
>
> For a lockless qdisc, do you believe TCQ_F_CAN_BYPASS is still a gain ?
>
For the benchmarks from pktgen it appears to be a win or mute to just
drop the TCQ_F_CAN_BYPASS (just taking a look at one sample below)
nolock & nobypass locked (current master)
----------------------------------------------
1: 1435796 1471479
2: 1880642 1746231
4: 1922935 1119626
8: 1585055 1001471
12: 1479273 989269
The only thing would be to test a bunch of netperf RR sessions to be
sure.
> Also !qdisc_qlen(q) looks racy anyway ?
Yep its racy unless you make it an atomic but this hurts performance
metrics. There is a patch further in the stack here that adds the
atomic variants but I tend to think we can just drop the bypass logic
in the lockless case assuming the netperf tests look good.
>
>> + qdisc_bstats_cpu_update(q, skb);
>> + if (sch_direct_xmit(skb, q, dev, txq, root_lock, true))
>> + __qdisc_run(q);
>> + rc = NET_XMIT_SUCCESS;
>> + } else {
>> + rc = q->enqueue(skb, q, &to_free) & NET_XMIT_MASK;
>> + __qdisc_run(q);
>> + }
>> +
>> + if (unlikely(to_free))
>> + kfree_skb_list(to_free);
>> + return rc;
>> + }
>> +
>
>
next prev parent reply other threads:[~2016-08-17 22:49 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-17 19:33 [RFC PATCH 00/13] Series short description John Fastabend
2016-08-17 19:33 ` [RFC PATCH 01/13] net: sched: allow qdiscs to handle locking John Fastabend
2016-08-17 22:33 ` Eric Dumazet
2016-08-17 22:49 ` John Fastabend
2016-08-17 22:34 ` Eric Dumazet
2016-08-17 22:48 ` John Fastabend [this message]
2016-08-17 19:34 ` [RFC PATCH 02/13] net: sched: qdisc_qlen for per cpu logic John Fastabend
2016-08-17 19:34 ` [RFC PATCH 03/13] net: sched: provide per cpu qstat helpers John Fastabend
2016-08-17 19:35 ` [RFC PATCH 04/13] net: sched: provide atomic qlen helpers for bypass case John Fastabend
2016-08-17 19:35 ` [RFC PATCH 05/13] net: sched: a dflt qdisc may be used with per cpu stats John Fastabend
2016-08-17 19:35 ` [RFC PATCH 06/13] net: sched: per cpu gso handlers John Fastabend
2016-08-17 19:36 ` [RFC PATCH 07/13] net: sched: support qdisc_reset on NOLOCK qdisc John Fastabend
2016-08-17 22:53 ` Eric Dumazet
2016-08-17 22:59 ` John Fastabend
2016-08-17 19:36 ` [RFC PATCH 08/13] net: sched: support skb_bad_tx with lockless qdisc John Fastabend
2016-08-17 22:58 ` Eric Dumazet
2016-08-17 23:00 ` John Fastabend
2016-08-23 20:11 ` John Fastabend
2016-08-17 19:37 ` [RFC PATCH 09/13] net: sched: helper to sum qlen John Fastabend
2016-08-17 19:37 ` [RFC PATCH 10/13] net: sched: lockless support for netif_schedule John Fastabend
2016-08-17 19:46 ` John Fastabend
2016-08-17 23:01 ` Eric Dumazet
2016-08-17 23:17 ` John Fastabend
2016-08-17 23:33 ` Eric Dumazet
2016-08-17 19:38 ` [RFC PATCH 11/13] net: sched: pfifo_fast use alf_queue John Fastabend
2016-08-19 10:13 ` Jesper Dangaard Brouer
2016-08-19 15:44 ` John Fastabend
2016-08-17 19:38 ` [RFC PATCH 12/13] net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mq John Fastabend
2016-08-17 19:49 ` John Fastabend
2016-08-17 23:04 ` Eric Dumazet
2016-08-17 23:18 ` John Fastabend
2016-08-17 19:39 ` [RFC PATCH 13/13] net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mqprio John Fastabend
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=57B4E9D2.1090302@gmail.com \
--to=john.fastabend@gmail$(echo .)com \
--cc=alexei.starovoitov@gmail$(echo .)com \
--cc=brouer@redhat$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=jhs@mojatatu$(echo .)com \
--cc=john.r.fastabend@intel$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=xiyou.wangcong@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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