mbox series

[RFC,v4,0/3] Some optimization for lockless qdisc

Message ID 1621502873-62720-1-git-send-email-linyunsheng@huawei.com
Headers show
Series Some optimization for lockless qdisc | expand

Message

Yunsheng Lin May 20, 2021, 9:27 a.m. UTC
Patch 1: remove unnecessary seqcount operation.
Patch 2: implement TCQ_F_CAN_BYPASS.
Patch 3: remove qdisc->empty.

RFC v4: Use STATE_MISSED and STATE_DRAINING to indicate non-empty
        qdisc, and add patch 1 and 3.

Yunsheng Lin (3):
  net: sched: avoid unnecessary seqcount operation for lockless qdisc
  net: sched: implement TCQ_F_CAN_BYPASS for lockless qdisc
  net: sched: remove qdisc->empty for lockless qdisc

 include/net/sch_generic.h | 26 +++++++++++++-------------
 net/core/dev.c            | 22 ++++++++++++++++++++--
 net/sched/sch_generic.c   | 23 ++++++++++++++++-------
 3 files changed, 49 insertions(+), 22 deletions(-)

Comments

Yunsheng Lin May 20, 2021, 9:45 a.m. UTC | #1
On 2021/5/20 17:27, Yunsheng Lin wrote:
> Patch 1: remove unnecessary seqcount operation.
> Patch 2: implement TCQ_F_CAN_BYPASS.
> Patch 3: remove qdisc->empty.
> 
> RFC v4: Use STATE_MISSED and STATE_DRAINING to indicate non-empty
>         qdisc, and add patch 1 and 3.

@Vladimir, Ahmad
It would be good to run your testcase to see if there are any
out of order for this version, because this version has used
STATE_MISSED and STATE_DRAINING to indicate non-empty qdisc,
thanks.

It is based on newest net branch with qdisc stuck patchset.

Some performance data as below:

pktgen + dummy netdev:
 threads  without+this_patch   with+this_patch      delta
    1       2.60Mpps            3.18Mpps             +22%
    2       3.84Mpps            5.72Mpps             +48%
    4       5.52Mpps            5.52Mpps             +0.0%
    8       2.77Mpps            2.81Mpps             +1.4%
   16       2.24Mpps            2.29Mpps             +2.2%

IP forward testing: 1.05Mpps increases to 1.15Mpps

> 
> Yunsheng Lin (3):
>   net: sched: avoid unnecessary seqcount operation for lockless qdisc
>   net: sched: implement TCQ_F_CAN_BYPASS for lockless qdisc
>   net: sched: remove qdisc->empty for lockless qdisc
> 
>  include/net/sch_generic.h | 26 +++++++++++++-------------
>  net/core/dev.c            | 22 ++++++++++++++++++++--
>  net/sched/sch_generic.c   | 23 ++++++++++++++++-------
>  3 files changed, 49 insertions(+), 22 deletions(-)
>
Vladimir Oltean May 20, 2021, 1:46 p.m. UTC | #2
Hi Yunsheng,

On Thu, May 20, 2021 at 05:45:14PM +0800, Yunsheng Lin wrote:
> On 2021/5/20 17:27, Yunsheng Lin wrote:
> > Patch 1: remove unnecessary seqcount operation.
> > Patch 2: implement TCQ_F_CAN_BYPASS.
> > Patch 3: remove qdisc->empty.
> > 
> > RFC v4: Use STATE_MISSED and STATE_DRAINING to indicate non-empty
> >         qdisc, and add patch 1 and 3.
> 
> @Vladimir, Ahmad
> It would be good to run your testcase to see if there are any
> out of order for this version, because this version has used
> STATE_MISSED and STATE_DRAINING to indicate non-empty qdisc,
> thanks.
> 
> It is based on newest net branch with qdisc stuck patchset.
> 
> Some performance data as below:
> 
> pktgen + dummy netdev:
>  threads  without+this_patch   with+this_patch      delta
>     1       2.60Mpps            3.18Mpps             +22%
>     2       3.84Mpps            5.72Mpps             +48%
>     4       5.52Mpps            5.52Mpps             +0.0%
>     8       2.77Mpps            2.81Mpps             +1.4%
>    16       2.24Mpps            2.29Mpps             +2.2%
> 
> IP forward testing: 1.05Mpps increases to 1.15Mpps

I will start the regression test with the flexcan driver on LS1028A and
let you know tomorrow or so if there is any TX reordering issue.
Vladimir Oltean May 21, 2021, 2:14 p.m. UTC | #3
On Thu, May 20, 2021 at 04:46:52PM +0300, Vladimir Oltean wrote:
> Hi Yunsheng,

> 

> On Thu, May 20, 2021 at 05:45:14PM +0800, Yunsheng Lin wrote:

> > On 2021/5/20 17:27, Yunsheng Lin wrote:

> > > Patch 1: remove unnecessary seqcount operation.

> > > Patch 2: implement TCQ_F_CAN_BYPASS.

> > > Patch 3: remove qdisc->empty.

> > > 

> > > RFC v4: Use STATE_MISSED and STATE_DRAINING to indicate non-empty

> > >         qdisc, and add patch 1 and 3.

> > 

> > @Vladimir, Ahmad

> > It would be good to run your testcase to see if there are any

> > out of order for this version, because this version has used

> > STATE_MISSED and STATE_DRAINING to indicate non-empty qdisc,

> > thanks.

> > 

> > It is based on newest net branch with qdisc stuck patchset.

> > 

> > Some performance data as below:

> > 

> > pktgen + dummy netdev:

> >  threads  without+this_patch   with+this_patch      delta

> >     1       2.60Mpps            3.18Mpps             +22%

> >     2       3.84Mpps            5.72Mpps             +48%

> >     4       5.52Mpps            5.52Mpps             +0.0%

> >     8       2.77Mpps            2.81Mpps             +1.4%

> >    16       2.24Mpps            2.29Mpps             +2.2%

> > 

> > IP forward testing: 1.05Mpps increases to 1.15Mpps

> 

> I will start the regression test with the flexcan driver on LS1028A and

> let you know tomorrow or so if there is any TX reordering issue.


14 million CAN frames later, I did not observe any TX reordering at all.