mbox series

[net-next,v2,0/3] Some optimization for lockless qdisc

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

Message

Yunsheng Lin June 3, 2021, 1:47 a.m. UTC
Patch 1: remove unnecessary seqcount operation.
Patch 2: implement TCQ_F_CAN_BYPASS.
Patch 3: remove qdisc->empty.

Performance data for pktgen in queue_xmit mode + dummy netdev
with pfifo_fast:

 threads    unpatched           patched             delta
    1       2.60Mpps            3.21Mpps             +23%
    2       3.84Mpps            5.56Mpps             +44%
    4       5.52Mpps            5.58Mpps             +1%
    8       2.77Mpps            2.76Mpps             -0.3%
   16       2.24Mpps            2.23Mpps             +0.4%

Performance for IP forward testing: 1.05Mpps increases to
1.16Mpps, about 10% improvement.

V2: Adjust the comment and commit log according to discussion
    in V1.
V1: Drop RFC tag, Add nolock_qdisc_is_empty() and do the qdisc
    empty checking without the protection of qdisc->seqlock to
    aviod doing unnecessary spin_trylock() for contention case.
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 | 31 ++++++++++++++++++-------------
 net/core/dev.c            | 27 +++++++++++++++++++++++++--
 net/sched/sch_generic.c   | 23 ++++++++++++++++-------
 3 files changed, 59 insertions(+), 22 deletions(-)

Comments

Jakub Kicinski June 3, 2021, 6:35 p.m. UTC | #1
On Thu, 3 Jun 2021 09:47:57 +0800 Yunsheng Lin wrote:
> Patch 1: remove unnecessary seqcount operation.
> Patch 2: implement TCQ_F_CAN_BYPASS.
> Patch 3: remove qdisc->empty.
> 
> Performance data for pktgen in queue_xmit mode + dummy netdev
> with pfifo_fast:
> 
>  threads    unpatched           patched             delta
>     1       2.60Mpps            3.21Mpps             +23%
>     2       3.84Mpps            5.56Mpps             +44%
>     4       5.52Mpps            5.58Mpps             +1%
>     8       2.77Mpps            2.76Mpps             -0.3%
>    16       2.24Mpps            2.23Mpps             +0.4%
> 
> Performance for IP forward testing: 1.05Mpps increases to
> 1.16Mpps, about 10% improvement.

Acked-by: Jakub Kicinski <kuba@kernel.org>
Vladimir Oltean June 8, 2021, 12:53 p.m. UTC | #2
On Thu, Jun 03, 2021 at 11:35:48AM -0700, Jakub Kicinski wrote:
> On Thu, 3 Jun 2021 09:47:57 +0800 Yunsheng Lin wrote:

> > Patch 1: remove unnecessary seqcount operation.

> > Patch 2: implement TCQ_F_CAN_BYPASS.

> > Patch 3: remove qdisc->empty.

> > 

> > Performance data for pktgen in queue_xmit mode + dummy netdev

> > with pfifo_fast:

> > 

> >  threads    unpatched           patched             delta

> >     1       2.60Mpps            3.21Mpps             +23%

> >     2       3.84Mpps            5.56Mpps             +44%

> >     4       5.52Mpps            5.58Mpps             +1%

> >     8       2.77Mpps            2.76Mpps             -0.3%

> >    16       2.24Mpps            2.23Mpps             +0.4%

> > 

> > Performance for IP forward testing: 1.05Mpps increases to

> > 1.16Mpps, about 10% improvement.

> 

> Acked-by: Jakub Kicinski <kuba@kernel.org>


Any idea why these patches are deferred in patchwork?
https://patchwork.kernel.org/project/netdevbpf/cover/1622684880-39895-1-git-send-email-linyunsheng@huawei.com/
Yunsheng Lin June 9, 2021, 1:31 a.m. UTC | #3
On 2021/6/8 20:53, Vladimir Oltean wrote:
> On Thu, Jun 03, 2021 at 11:35:48AM -0700, Jakub Kicinski wrote:

>> On Thu, 3 Jun 2021 09:47:57 +0800 Yunsheng Lin wrote:

>>> Patch 1: remove unnecessary seqcount operation.

>>> Patch 2: implement TCQ_F_CAN_BYPASS.

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

>>>

>>> Performance data for pktgen in queue_xmit mode + dummy netdev

>>> with pfifo_fast:

>>>

>>>  threads    unpatched           patched             delta

>>>     1       2.60Mpps            3.21Mpps             +23%

>>>     2       3.84Mpps            5.56Mpps             +44%

>>>     4       5.52Mpps            5.58Mpps             +1%

>>>     8       2.77Mpps            2.76Mpps             -0.3%

>>>    16       2.24Mpps            2.23Mpps             +0.4%

>>>

>>> Performance for IP forward testing: 1.05Mpps increases to

>>> 1.16Mpps, about 10% improvement.

>>

>> Acked-by: Jakub Kicinski <kuba@kernel.org>

> 

> Any idea why these patches are deferred in patchwork?

> https://patchwork.kernel.org/project/netdevbpf/cover/1622684880-39895-1-git-send-email-linyunsheng@huawei.com/


I suppose it is a controversial change, which need more time
hanging to be reviewed and tested.

By the way, I did not pick up your "Tested-by" from previous
RFC version because there is some change between those version
that deserves a retesting. So it would be good to have a
"Tested-by" from you after confirming no out of order happening
for this version, thanks.
Jakub Kicinski June 9, 2021, 4:20 p.m. UTC | #4
On Wed, 9 Jun 2021 09:31:39 +0800 Yunsheng Lin wrote:
> On 2021/6/8 20:53, Vladimir Oltean wrote:

> > On Thu, Jun 03, 2021 at 11:35:48AM -0700, Jakub Kicinski wrote:  

> >> On Thu, 3 Jun 2021 09:47:57 +0800 Yunsheng Lin wrote:  

> >>> Patch 1: remove unnecessary seqcount operation.

> >>> Patch 2: implement TCQ_F_CAN_BYPASS.

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

> >>>

> >>> Performance data for pktgen in queue_xmit mode + dummy netdev

> >>> with pfifo_fast:

> >>>

> >>>  threads    unpatched           patched             delta

> >>>     1       2.60Mpps            3.21Mpps             +23%

> >>>     2       3.84Mpps            5.56Mpps             +44%

> >>>     4       5.52Mpps            5.58Mpps             +1%

> >>>     8       2.77Mpps            2.76Mpps             -0.3%

> >>>    16       2.24Mpps            2.23Mpps             +0.4%

> >>>

> >>> Performance for IP forward testing: 1.05Mpps increases to

> >>> 1.16Mpps, about 10% improvement.  

> >>

> >> Acked-by: Jakub Kicinski <kuba@kernel.org>  

> > 

> > Any idea why these patches are deferred in patchwork?

> > https://patchwork.kernel.org/project/netdevbpf/cover/1622684880-39895-1-git-send-email-linyunsheng@huawei.com/  

> 

> I suppose it is a controversial change, which need more time

> hanging to be reviewed and tested.


That'd be my guess also. A review from area experts would be great,
perhaps from Cong, John, Michal..  If the review doesn't come by
Friday - I'd repost.
Vladimir Oltean June 15, 2021, 11:29 p.m. UTC | #5
On Wed, Jun 09, 2021 at 09:31:39AM +0800, Yunsheng Lin wrote:
> By the way, I did not pick up your "Tested-by" from previous

> RFC version because there is some change between those version

> that deserves a retesting. So it would be good to have a

> "Tested-by" from you after confirming no out of order happening

> for this version, thanks.


Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> # flexcan