linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
@ 2013-10-22 21:41 fengguang.wu
  2013-10-22 22:00 ` David Miller
  0 siblings, 1 reply; 11+ messages in thread
From: fengguang.wu @ 2013-10-22 21:41 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: netdev, LKML

Hi Eric,

We noticed big netperf throughput regressions

    a4fe34bf902b8f709c63      2e685cad57906e19add7  
------------------------  ------------------------  
                  707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
                 2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
                 3483.00       -27.2%      2536.00  TOTAL netperf.Throughput_Mbps

and bisected it to

commit 2e685cad57906e19add7189b5ff49dfb6aaa21d3
Author: Eric W. Biederman <ebiederm@xmission.com>
Date:   Sat Oct 19 16:26:19 2013 -0700

    tcp_memcontrol: Kill struct tcp_memcontrol
    
    Replace the pointers in struct cg_proto with actual data fields and kill
    struct tcp_memcontrol as it is not fully redundant.
    
    This removes a confusing, unnecessary layer of abstraction.
    
    Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

:040000 040000 a1896af98145c8ae2765a787845c43c9700c7dc0 02c93b50f66f1d1b34983bf3cc7e9a0dcc7105dc M	include
:040000 040000 ebe5d0619b54ddf730224f6581f595491eb36989 cd560b4a6e56cecac931814ba16420e167eb68f6 M	mm
:040000 040000 5df01f70484e07fbf98a7d5b8e0a53270777ac3d 1f8d1b340d8810a79691777f4e3ee529027b3c9b M	net
bisect run success

# bad: [aec2994e1799312822a30fefc27205e7360fe5af] Merge 'pwm/for-next' into devel-hourly-2013102222
# good: [31d141e3a666269a3b6fcccddb0351caf7454240] Linux 3.12-rc6
git bisect start 'aec2994e1799312822a30fefc27205e7360fe5af' '31d141e3a666269a3b6fcccddb0351caf7454240' '--'
# good: [ef26157747d42254453f6b3ac2bd8bd3c53339c3] batman-adv: tvlv - basic infrastructure
git bisect good ef26157747d42254453f6b3ac2bd8bd3c53339c3
# bad: [cc6a88faebab06b0323818cd102a6aae443cf34a] Merge 'netdev-next/master' into devel-hourly-2013102222
git bisect bad cc6a88faebab06b0323818cd102a6aae443cf34a
# good: [5cda73b68ebf7e08586d61e6777e64e12df23f07] Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
git bisect good 5cda73b68ebf7e08586d61e6777e64e12df23f07
# good: [a8fab0744585c1ab61009bfc1a1958f28e1c864f] x86/jump_label: expect default_nop if static_key gets enabled on boot-up
git bisect good a8fab0744585c1ab61009bfc1a1958f28e1c864f
# good: [21d35d212469c3138f8916f7e47b779313d79751] net: sky2: remove unnecessary pci_set_drvdata()
git bisect good 21d35d212469c3138f8916f7e47b779313d79751
# bad: [61c1db7fae21ed33c614356a43bf6580c5e53118] ipv6: sit: add GSO/TSO support
git bisect bad 61c1db7fae21ed33c614356a43bf6580c5e53118
# good: [a4fe34bf902b8f709c635ab37f1f39de0b86cff2] tcp_memcontrol: Remove the per netns control.
git bisect good a4fe34bf902b8f709c635ab37f1f39de0b86cff2
# bad: [1b66917d6b76db0abe1a1bbf86b2517ba8b91d98] cgxb4: remove duplicate include in cxgb4.h
git bisect bad 1b66917d6b76db0abe1a1bbf86b2517ba8b91d98
# bad: [0a6fa23dcb10eeb21adfd9955f7030f952a8122d] ipv4: Use math to point per net sysctls into the appropriate struct net.
git bisect bad 0a6fa23dcb10eeb21adfd9955f7030f952a8122d
# bad: [2e685cad57906e19add7189b5ff49dfb6aaa21d3] tcp_memcontrol: Kill struct tcp_memcontrol
git bisect bad 2e685cad57906e19add7189b5ff49dfb6aaa21d3
# first bad commit: [2e685cad57906e19add7189b5ff49dfb6aaa21d3] tcp_memcontrol: Kill struct tcp_memcontrol


                              netperf.Throughput_Mbps

   750 ++-------------------------------------------------------------------+
       *...*...                             .*...                         ..*
   700 ++      *...*..*...*...*...*...*...*.     *...*...*...*...*..*...*.  |
       |                                                                    |
   650 ++                                                                   |
       |                                                                    |
   600 ++                                                                   |
       |                                                                    |
   550 ++                                                                   |
       |                                                                    |
   500 ++                                                                   |
       |                                                                    |
   450 ++                                                                   |
       O   O       O  O   O       O       O  O   O   O   O   O              |
   400 ++------O--------------O-------O-------------------------------------+


                                  vmstat.system.in

   17200 ++-----------------------------------------------------------------+
   17100 ++               ..*..*.      *...*..                              |
         |          *...*.       ..  ..       *                        .*...|
   17000 ++       ..                .          +                     *.     *
   16900 ++..*.. .                 *            +                  ..       |
   16800 *+     *                                +       *        .         |
   16700 ++                                       *..   + +      *          |
         |                                           . +   +   ..           |
   16600 ++                                           *     + .             |
   16500 ++                                                  *              |
   16400 ++                                                                 |
   16300 ++                                                                 |
         O          O   O      O       O              O                     |
   16200 ++  O  O           O      O       O  O   O      O   O              |
   16100 ++-----------------------------------------------------------------+


                                   vmstat.system.cs

   550000 ++----------------------------------------------------------------+
   500000 *+..*..*..        *...*..    *...  ..*..*..    .*..*...*..    *...*
          |         .     ..       . ..    *.        . ..           . ..    |
   450000 ++         *...*          *                 *              *      |
   400000 ++                                                                |
   350000 ++                                                                |
   300000 ++                                                                |
          |                                                                 |
   250000 ++                                                                |
   200000 ++                                                                |
   150000 ++                                                                |
   100000 ++                                                                |
          |                                                                 |
    50000 O+  O  O   O   O  O   O   O  O   O   O  O   O   O  O              |
        0 ++----------------------------------------------------------------+


                          lock_stat.slock-AF_INET.contentions

   150000 ++----------------------------------------------------------------+
          |                 *...         ..*...                             |
   140000 ++               +    *      *.      *                            |
   130000 ++              +      :    :         :                           |
          |            ..*        :   :         :                       *...*
   120000 ++ .*..  ..*.           :  :         O :                    ..    |
   110000 ++.    *.                : :           :                  .*      |
          *                         *             :       *       ..        |
   100000 ++                                      *.     + :     *          |
    90000 ++                                        ..  +   :  ..           |
          |                                            +    : .             |
    80000 ++                           O              *      *              |
    70000 O+         O   O      O                     O                     |
          |   O             O       O             O          O              |
    60000 ++-----O-------------------------O--------------O-----------------+


                 lock_stat.slock-AF_INET.contentions.lock_sock_nested

   130000 ++----------------------------------------------------------------+
          |                                                                 |
   120000 ++                *...         ..*...*                            |
   110000 ++               +    *      *.       :                           |
          |               +      +    :        O:                       *...*
   100000 ++ .*..   .*...*        +   :          :                    ..    |
          |..     ..               + :           :                  .*      |
    90000 *+     *                  *             :       *       ..        |
          |                                       *.     + :     *          |
    80000 ++                                        ..  +   :  ..           |
    70000 ++                                           +    : .             |
          |              O      O      O              *      *              |
    60000 O+         O                            O   O                     |
          |   O  O          O       O      O              O  O              |
    50000 ++----------------------------------------------------------------+


                    lock_stat.slock-AF_INET.contentions.tcp_v4_rcv

   150000 ++----------------------------------------------------------------+
          |                 *...                                            |
   140000 ++               +    *      *...*...*                            |
   130000 ++              +      :    :         :                           |
          |            ..*        :   :         :                       *...*
   120000 ++ .*..  ..*.           :  :         O :                    ..    |
   110000 ++.    *.                : :           :                  .*      |
          *                         *             :               ..        |
   100000 ++                                      *.      *      *          |
    90000 ++                                        ..  .. +   ..           |
          |                                            .    + .             |
    80000 ++                           O              *      *              |
    70000 ++         O   O      O                     O                     |
          O   O             O       O             O          O              |
    60000 ++-----O-------------------------O--------------O-----------------+


                        lock_stat.slock-AF_INET/1.contentions

   50000 ++-----------------------------------------------------------------+
         |                  *..                                           ..*
   45000 ++                +           *...*..                          *.  |
   40000 ++               +    *.     +       *..                     ..    |
         |  .*..         +       ..  +           .                 ..*      |
   35000 ++.    *...  ..*           +             *      *.      *.         |
         *          *.             *               :    :  ..  ..           |
   30000 ++                                         :   :     .             |
         |                                          :  :     *              |
   25000 ++                                          : :                    |
   20000 ++                                           *                     |
         |                                    O                             |
   15000 ++                            O              O                     |
         O   O  O   O   O   O  O   O       O      O      O   O              |
   10000 ++-----------------------------------------------------------------+


                  lock_stat.slock-AF_INET/1.contentions.tcp_v4_rcv

   50000 ++-----------------------------------------------------------------+
         |                  *..                                           ..*
   45000 ++                +           *...*..                          *.  |
   40000 ++               +    *.     +       *..                     ..    |
         |  .*..         +       ..  +           .                 ..*      |
   35000 ++.    *...  ..*           +             *      *.      *.         |
         *          *.             *               :    :  ..  ..           |
   30000 ++                                         :   :     .             |
         |                                          :  :     *              |
   25000 ++                                          : :                    |
   20000 ++                                           *                     |
         |                                    O                             |
   15000 ++                            O              O                     |
         O   O  O   O   O   O  O   O       O      O      O   O              |
   10000 ++-----------------------------------------------------------------+


                 lock_stat.slock-AF_INET/1.contentions.release_sock

   35000 ++-----------------------------------------------------------------*
         |                  *..                                         *.  |
   30000 ++                +           *...*..*.                      ..    |
         |                +    *..   ..         ..                 ..*      |
         |  .*..         +        . .                    *.      *.         |
   25000 ++.    *...*...*          *              *     :  ..  ..           |
         *                                         +    :     .             |
   20000 ++                                         +  :     *              |
         |                                           + :                    |
   15000 ++                                           *                     |
         |                                                                  |
         |                                    O                             |
   10000 O+         O   O      O       O          O   O                     |
         |   O  O           O      O       O             O   O              |
    5000 ++-----------------------------------------------------------------+


                           lock_stat.&rq->lock.contentions

   45000 ++-----------------------------------------------------------------+
         |                 .*..        *...                                 |
   40000 ++              ..    *..   ..    *..                              |
   35000 ++ .*..      ..*         . .         *.                       .*...*
         |..    *...*.             *            ..                  .*.     |
   30000 *+                                                       ..        |
   25000 ++                                       *..    *...  ..*          |
         |                                           . ..    *.             |
   20000 ++                                           *                     |
   15000 ++                                                                 |
         |                                                                  |
   10000 ++                                                                 |
    5000 O+  O  O   O   O   O  O   O   O   O  O   O   O      O              |
         |                                               O                  |
       0 ++-----------------------------------------------------------------+


                   lock_stat.&rq->lock.contentions.try_to_wake_up

   35000 ++-----------------------------------------------------------------+
         |                                                                  |
   30000 ++                .*..            *..                              |
         |   *           ..    *..        :                                 |
   25000 ++.. :         *         .       :   *.                        *   |
         |.   :        :           *.    :      ..                      ::  |
   20000 *+    :       :             .. :                       .*     :  : |
         |     :      :                 :         *...        ..  +    :  : |
   15000 ++     :    :                 *              *      *     +  :    :|
         |      *... :                                 +   ..       + :     *
   10000 ++         *                                   + .          *      |
         |                                               *                  |
    5000 ++                                   O                             |
         O   O  O   O   O   O  O       O   O          O  O   O              |
       0 ++------------------------O--------------O-------------------------+


                     lock_stat.&rq->lock.contentions.__schedule

   35000 ++-----------------------------------------------------------------+
         |                                                                  |
   30000 ++                 *..                                             |
         |                ..              .*..                              |
   25000 ++ .*           .     *...     ..                              *.  |
         |..  +        .*          *...*      *                        :  ..|
   20000 *+    +     ..                        +                       :    |
         |      *...*                           +              ..*... :     *
   15000 ++                                      +         ..*.      *      |
         |                                        *...*..*.                 |
   10000 ++                                                                 |
         |                                                                  |
    5000 ++                    O                                            |
         O   O  O   O   O   O      O   O   O  O   O   O  O   O              |
       0 ++-----------------------------------------------------------------+


             lock_stat.&(&base->lock)->rlock.contentions.lock_timer_base

   18000 ++----------------------------*------------------------------------+
         |                ..*..       +    *..                         .*...*
   16000 ++           ..*.     *..   +        *...                  .*.     |
   14000 ++ .*..*...*.            . +             *      *.       ..        |
         |..                       *               +    :  ..   .*          |
   12000 *+                                         +   :     ..            |
   10000 ++                                          + :     *              |
         |                                            *                     |
    8000 ++                                                                 |
    6000 ++                                                                 |
         |                                                                  |
    4000 ++                                                                 |
    2000 ++                    O                                            |
         O   O  O   O   O   O      O   O   O  O   O   O  O   O              |
       0 ++-----------------------------------------------------------------+


                     lock_stat.&(&n->list_lock)->rlock.contentions

   140000 ++----------------------------------------------------------------+
          |                                       O                         |
   120000 O+  O  O   O   O  O   O                     O                     |
          |                         O  O   O   O          O  O              |
   100000 ++                                                                |
          |                                                                 |
    80000 ++                                                                |
          |                                                                 |
    60000 ++                                                                |
          |                                                                 |
    40000 ++                                                                |
          |                                                                 |
    20000 ++                                                                |
          |                                                                 |
        0 *+--*--*---*---*--*---*---*--*---*---*--*---*---*--*---*---*--*---*


            lock_stat.&(&n->list_lock)->rlock.contentions.get_partial_node

   250000 ++----------------------------------------------------------------+
          |                                                                 |
          O                                       O                         |
   200000 ++  O  O   O   O  O   O   O  O   O   O      O      O              |
          |                                               O                 |
          |                                                                 |
   150000 ++                                                                |
          |                                                                 |
   100000 ++                                                                |
          |                                                                 |
          |                                                                 |
    50000 ++                                                                |
          |                                                                 |
          |                                                                 |
        0 *+--*--*---*---*--*---*---*--*---*---*--*---*---*--*---*---*--*---*


           lock_stat.&(&n->list_lock)->rlock.contentions.unfreeze_partials

   45000 ++-----------------------------------------------------------------+
         O                                        O                         |
   40000 ++         O   O   O                         O                     |
   35000 ++  O  O              O   O       O  O          O   O              |
         |                             O                                    |
   30000 ++                                                                 |
   25000 ++                                                                 |
         |                                                                  |
   20000 ++                                                                 |
   15000 ++                                                                 |
         |                                                                  |
   10000 ++                                                                 |
    5000 ++                                                                 |
         |                                                                  |
       0 *+--*--*---*---*---*--*---*---*---*--*---*---*--*---*---*---*--*---*


                                  iostat.cpu.user

   1.8 ++-------------------------------------------------------------------+
       *...*...*.         *...*.      *...*..                               |
   1.6 ++        ..     ..      ..  ..       *...*..    .*...*...*      *...*
       |               .           .                . ..          +   ..    |
       |           *..*           *                  *             + .      |
   1.4 ++                                                           *       |
       |                                                                    |
   1.2 ++                                                                   |
       |                                                                    |
     1 ++                                                                   |
       |                                                                    |
       |                                                                    |
   0.8 ++                         O       O      O   O                      |
       O   O   O   O  O   O   O       O      O           O   O              |
   0.6 ++-------------------------------------------------------------------+


                                  iostat.cpu.system

   96.6 ++------------------------------------------------------------------+
        |   O          O              O   O       O  O   O                  |
   96.4 O+      O  O       O   O  O                          O              |
        |                                                                   |
        |                                                                   |
   96.2 ++                                                                  |
        |                                                                   |
     96 ++                                                                  |
        |                                                                   |
   95.8 ++                                    O                             |
        |            ..*.         *.                 *..            *..     |
        |          *.    ..      +  ..             ..   .         ..   .  ..*
   95.6 ++       ..             +           ..*...*      *...  ..*      *.  |
        |     ..*          *...*      *...*.                 *.             |
   95.4 *+--*---------------------------------------------------------------+


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
  2013-10-22 21:41 -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol" fengguang.wu
@ 2013-10-22 22:00 ` David Miller
  2013-10-23  4:38   ` Eric W. Biederman
  0 siblings, 1 reply; 11+ messages in thread
From: David Miller @ 2013-10-22 22:00 UTC (permalink / raw)
  To: fengguang.wu; +Cc: ebiederm, netdev, linux-kernel

From: fengguang.wu@intel.com
Date: Tue, 22 Oct 2013 22:41:29 +0100

> We noticed big netperf throughput regressions
> 
>     a4fe34bf902b8f709c63      2e685cad57906e19add7  
> ------------------------  ------------------------  
>                   707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
>                  2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
>                  3483.00       -27.2%      2536.00  TOTAL netperf.Throughput_Mbps
> 
> and bisected it to
> 
> commit 2e685cad57906e19add7189b5ff49dfb6aaa21d3
> Author: Eric W. Biederman <ebiederm@xmission.com>
> Date:   Sat Oct 19 16:26:19 2013 -0700
> 
>     tcp_memcontrol: Kill struct tcp_memcontrol

Eric please look into this, I'd rather have a fix to apply than revert your
work.

Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
  2013-10-22 22:00 ` David Miller
@ 2013-10-23  4:38   ` Eric W. Biederman
       [not found]     ` <20131023061019.GA15698@localhost>
  2013-10-23 12:25     ` Christoph Paasch
  0 siblings, 2 replies; 11+ messages in thread
From: Eric W. Biederman @ 2013-10-23  4:38 UTC (permalink / raw)
  To: David Miller; +Cc: fengguang.wu, netdev, linux-kernel

David Miller <davem@davemloft.net> writes:

> From: fengguang.wu@intel.com
> Date: Tue, 22 Oct 2013 22:41:29 +0100
>
>> We noticed big netperf throughput regressions
>> 
>>     a4fe34bf902b8f709c63      2e685cad57906e19add7  
>> ------------------------  ------------------------  
>>                   707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
>>                  2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
>>                  3483.00       -27.2%      2536.00  TOTAL netperf.Throughput_Mbps
>> 
>> and bisected it to
>> 
>> commit 2e685cad57906e19add7189b5ff49dfb6aaa21d3
>> Author: Eric W. Biederman <ebiederm@xmission.com>
>> Date:   Sat Oct 19 16:26:19 2013 -0700
>> 
>>     tcp_memcontrol: Kill struct tcp_memcontrol
>
> Eric please look into this, I'd rather have a fix to apply than revert your
> work.

Will do I expect some ordering changed, and that changed the cache line
behavior.

If I can't find anything we can revert this one particular patch without
affecting anything else, but it would be nice to keep the data structure
smaller.

Fengguag what would I need to do to reproduce this?

Eric


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
       [not found]     ` <20131023061019.GA15698@localhost>
@ 2013-10-23  9:43       ` Eric W. Biederman
  2013-10-23 11:46         ` Fengguang Wu
  0 siblings, 1 reply; 11+ messages in thread
From: Eric W. Biederman @ 2013-10-23  9:43 UTC (permalink / raw)
  To: Fengguang Wu; +Cc: David Miller, netdev, linux-kernel

Fengguang Wu <fengguang.wu@intel.com> writes:

> On Tue, Oct 22, 2013 at 09:38:10PM -0700, Eric W. Biederman wrote:
>> David Miller <davem@davemloft.net> writes:
>> 
>> > From: fengguang.wu@intel.com
>> > Date: Tue, 22 Oct 2013 22:41:29 +0100
>> >
>> >> We noticed big netperf throughput regressions
>> >> 
>> >>     a4fe34bf902b8f709c63      2e685cad57906e19add7  
>> >> ------------------------  ------------------------  
>> >>                   707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
>> >>                  2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
>> >>                  3483.00       -27.2%      2536.00  TOTAL netperf.Throughput_Mbps
>> >> 
>> >> and bisected it to
>> >> 
>> >> commit 2e685cad57906e19add7189b5ff49dfb6aaa21d3
>> >> Author: Eric W. Biederman <ebiederm@xmission.com>
>> >> Date:   Sat Oct 19 16:26:19 2013 -0700
>> >> 
>> >>     tcp_memcontrol: Kill struct tcp_memcontrol
>> >
>> > Eric please look into this, I'd rather have a fix to apply than revert your
>> > work.
>> 
>> Will do I expect some ordering changed, and that changed the cache line
>> behavior.
>> 
>> If I can't find anything we can revert this one particular patch without
>> affecting anything else, but it would be nice to keep the data structure
>> smaller.
>> 
>> Fengguag what would I need to do to reproduce this?
>
> Eric, attached is the kernel config.
>
> We used these commands in the test:
>
>         netserver
>         netperf -t TCP_STREAM -c -C -l 120      # repeat 64 times and get average
>
> btw, we've got more complete change set (attached) and also noticed
> performance increase in the TCP_SENDFILE case:
>
>     a4fe34bf902b8f709c63      2e685cad57906e19add7
> ------------------------  ------------------------
>                   707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
>                  2572.20       -17.7%      2116.20  lkp-sb03/micro/netperf/120s-200%-TCP_MAERTS
>                  2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
>                  1006.60       -54.4%       459.40  lkp-sbx04/micro/netperf/120s-200%-TCP_STREAM
>                  3278.60       -25.2%      2453.80  lkp-t410/micro/netperf/120s-200%-TCP_MAERTS
>                  1902.80       +21.7%      2315.00  lkp-t410/micro/netperf/120s-200%-TCP_SENDFILE
>                  3345.40       -26.7%      2451.00  lkp-t410/micro/netperf/120s-200%-TCP_STREAM
>                 15588.60       -20.9%     12331.40  TOTAL netperf.Throughput_Mbps

I have a second question.  Do you mount the cgroup filesystem?  Do you
set memory.kmem.tcp.limit_in_bytes?

If you aren't setting any memory cgroup limits or creating any groups
this change should not have had any effect whatsoever.  And you haven't
mentioned it so I don't expect you are enabling the memory cgroup limits
explicitly.

If you have enabled the memory cgroups can you please describe your
configuration as that may play a significant role.

Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
  2013-10-23  9:43       ` Eric W. Biederman
@ 2013-10-23 11:46         ` Fengguang Wu
  0 siblings, 0 replies; 11+ messages in thread
From: Fengguang Wu @ 2013-10-23 11:46 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: David Miller, netdev, linux-kernel

On Wed, Oct 23, 2013 at 02:43:14AM -0700, Eric W. Biederman wrote:
> Fengguang Wu <fengguang.wu@intel.com> writes:
> 
> > On Tue, Oct 22, 2013 at 09:38:10PM -0700, Eric W. Biederman wrote:
> >> David Miller <davem@davemloft.net> writes:
> >> 
> >> > From: fengguang.wu@intel.com
> >> > Date: Tue, 22 Oct 2013 22:41:29 +0100
> >> >
> >> >> We noticed big netperf throughput regressions
> >> >> 
> >> >>     a4fe34bf902b8f709c63      2e685cad57906e19add7  
> >> >> ------------------------  ------------------------  
> >> >>                   707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
> >> >>                  2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
> >> >>                  3483.00       -27.2%      2536.00  TOTAL netperf.Throughput_Mbps
> >> >> 
> >> >> and bisected it to
> >> >> 
> >> >> commit 2e685cad57906e19add7189b5ff49dfb6aaa21d3
> >> >> Author: Eric W. Biederman <ebiederm@xmission.com>
> >> >> Date:   Sat Oct 19 16:26:19 2013 -0700
> >> >> 
> >> >>     tcp_memcontrol: Kill struct tcp_memcontrol
> >> >
> >> > Eric please look into this, I'd rather have a fix to apply than revert your
> >> > work.
> >> 
> >> Will do I expect some ordering changed, and that changed the cache line
> >> behavior.
> >> 
> >> If I can't find anything we can revert this one particular patch without
> >> affecting anything else, but it would be nice to keep the data structure
> >> smaller.
> >> 
> >> Fengguag what would I need to do to reproduce this?
> >
> > Eric, attached is the kernel config.
> >
> > We used these commands in the test:
> >
> >         netserver
> >         netperf -t TCP_STREAM -c -C -l 120      # repeat 64 times and get average

Sorry it's not about repeating, but running 64 netperf in parallel.
The number 64 is 2 times the number of logical CPUs.

> > btw, we've got more complete change set (attached) and also noticed
> > performance increase in the TCP_SENDFILE case:
> >
> >     a4fe34bf902b8f709c63      2e685cad57906e19add7
> > ------------------------  ------------------------
> >                   707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
> >                  2572.20       -17.7%      2116.20  lkp-sb03/micro/netperf/120s-200%-TCP_MAERTS
> >                  2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
> >                  1006.60       -54.4%       459.40  lkp-sbx04/micro/netperf/120s-200%-TCP_STREAM
> >                  3278.60       -25.2%      2453.80  lkp-t410/micro/netperf/120s-200%-TCP_MAERTS
> >                  1902.80       +21.7%      2315.00  lkp-t410/micro/netperf/120s-200%-TCP_SENDFILE
> >                  3345.40       -26.7%      2451.00  lkp-t410/micro/netperf/120s-200%-TCP_STREAM
> >                 15588.60       -20.9%     12331.40  TOTAL netperf.Throughput_Mbps
> 
> I have a second question.  Do you mount the cgroup filesystem?  Do you
> set memory.kmem.tcp.limit_in_bytes?

No I didn't mount cgroup at all.

> If you aren't setting any memory cgroup limits or creating any groups
> this change should not have had any effect whatsoever.  And you haven't
> mentioned it so I don't expect you are enabling the memory cgroup limits
> explicitly.
> 
> If you have enabled the memory cgroups can you please describe your
> configuration as that may play a significant role.
> 
> Eric

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
  2013-10-23  4:38   ` Eric W. Biederman
       [not found]     ` <20131023061019.GA15698@localhost>
@ 2013-10-23 12:25     ` Christoph Paasch
  2013-10-23 13:02       ` Eric Dumazet
  2013-10-23 22:07       ` -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol" Fengguang Wu
  1 sibling, 2 replies; 11+ messages in thread
From: Christoph Paasch @ 2013-10-23 12:25 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: David Miller, fengguang.wu, netdev, linux-kernel

Hello,

On 22/10/13 - 21:38:10, Eric W. Biederman wrote:
> David Miller <davem@davemloft.net> writes:
> > From: fengguang.wu@intel.com
> > Date: Tue, 22 Oct 2013 22:41:29 +0100
> >
> >> We noticed big netperf throughput regressions
> >> 
> >>     a4fe34bf902b8f709c63      2e685cad57906e19add7  
> >> ------------------------  ------------------------  
> >>                   707.40       -40.7%       419.60  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
> >>                  2775.60       -23.7%      2116.40  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
> >>                  3483.00       -27.2%      2536.00  TOTAL netperf.Throughput_Mbps
> >> 
> >> and bisected it to
> >> 
> >> commit 2e685cad57906e19add7189b5ff49dfb6aaa21d3
> >> Author: Eric W. Biederman <ebiederm@xmission.com>
> >> Date:   Sat Oct 19 16:26:19 2013 -0700
> >> 
> >>     tcp_memcontrol: Kill struct tcp_memcontrol
> >
> > Eric please look into this, I'd rather have a fix to apply than revert your
> > work.
> 
> Will do I expect some ordering changed, and that changed the cache line
> behavior.

may it be the below?


Cheers,
Christoph

----
From: Christoph Paasch <christoph.paasch@uclouvain.be>
Subject: [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure

2e685cad57 (tcp_memcontrol: Kill struct tcp_memcontrol) falsly modified
the access to memory_pressure of sk->sk_prot->memory_pressure. The patch
did modify the memory_pressure-field of struct cg_proto, but not the one
of struct proto.

So, the access to sk_prot->memory_pressure should not be changed.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
---
 include/net/sock.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index c93542f..e3a18ff 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1137,7 +1137,7 @@ static inline bool sk_under_memory_pressure(const struct sock *sk)
        if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
                return !!sk->sk_cgrp->memory_pressure;

-       return !!sk->sk_prot->memory_pressure;
+       return !!*sk->sk_prot->memory_pressure;
 }

 static inline void sk_leave_memory_pressure(struct sock *sk)
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
  2013-10-23 12:25     ` Christoph Paasch
@ 2013-10-23 13:02       ` Eric Dumazet
  2013-10-23 19:55         ` [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure Eric W. Biederman
  2013-10-23 19:58         ` Eric W. Biederman
  2013-10-23 22:07       ` -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol" Fengguang Wu
  1 sibling, 2 replies; 11+ messages in thread
From: Eric Dumazet @ 2013-10-23 13:02 UTC (permalink / raw)
  To: Christoph Paasch
  Cc: Eric W. Biederman, David Miller, fengguang.wu, netdev, linux-kernel

On Wed, 2013-10-23 at 14:25 +0200, Christoph Paasch wrote:

> may it be the below?
> 
> 
> Cheers,
> Christoph
> 
> ----
> From: Christoph Paasch <christoph.paasch@uclouvain.be>
> Subject: [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure
> 
> 2e685cad57 (tcp_memcontrol: Kill struct tcp_memcontrol) falsly modified
> the access to memory_pressure of sk->sk_prot->memory_pressure. The patch
> did modify the memory_pressure-field of struct cg_proto, but not the one
> of struct proto.
> 
> So, the access to sk_prot->memory_pressure should not be changed.
> 
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
>  include/net/sock.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/sock.h b/include/net/sock.h
> index c93542f..e3a18ff 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -1137,7 +1137,7 @@ static inline bool sk_under_memory_pressure(const struct sock *sk)
>         if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
>                 return !!sk->sk_cgrp->memory_pressure;
> 
> -       return !!sk->sk_prot->memory_pressure;
> +       return !!*sk->sk_prot->memory_pressure;
>  }
> 
>  static inline void sk_leave_memory_pressure(struct sock *sk)

Nice catch, thanks !

Acked-by: Eric Dumazet <edumazet@google.com>




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure
  2013-10-23 13:02       ` Eric Dumazet
@ 2013-10-23 19:55         ` Eric W. Biederman
  2013-10-23 20:15           ` David Miller
  2013-10-23 19:58         ` Eric W. Biederman
  1 sibling, 1 reply; 11+ messages in thread
From: Eric W. Biederman @ 2013-10-23 19:55 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Christoph Paasch, fengguang.wu, netdev, linux-kernel, Eric Dumazet

From: Christoph Paasch <christoph.paasch@uclouvain.be>
Date: Wed, 23 Oct 2013 12:49:21 -0700

2e685cad57 (tcp_memcontrol: Kill struct tcp_memcontrol) falsly modified
the access to memory_pressure of sk->sk_prot->memory_pressure. The patch
did modify the memory_pressure-field of struct cg_proto, but not the one
of struct proto.

So, the access to sk_prot->memory_pressure should not be changed.

Acked-by: Eric Dumazet <edumazet@google.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 include/net/sock.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index c93542f92420..e3a18ff0c38b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1137,7 +1137,7 @@ static inline bool sk_under_memory_pressure(const struct sock *sk)
 	if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
 		return !!sk->sk_cgrp->memory_pressure;
 
-	return !!sk->sk_prot->memory_pressure;
+	return !!*sk->sk_prot->memory_pressure;
 }
 
 static inline void sk_leave_memory_pressure(struct sock *sk)
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure
  2013-10-23 13:02       ` Eric Dumazet
  2013-10-23 19:55         ` [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure Eric W. Biederman
@ 2013-10-23 19:58         ` Eric W. Biederman
  1 sibling, 0 replies; 11+ messages in thread
From: Eric W. Biederman @ 2013-10-23 19:58 UTC (permalink / raw)
  To: David Miller
  Cc: Christoph Paasch, fengguang.wu, netdev, linux-kernel, Eric Dumazet

From: Christoph Paasch <christoph.paasch@uclouvain.be>
Date: Wed, 23 Oct 2013 12:49:21 -0700

2e685cad57 (tcp_memcontrol: Kill struct tcp_memcontrol) falsly modified
the access to memory_pressure of sk->sk_prot->memory_pressure. The patch
did modify the memory_pressure-field of struct cg_proto, but not the one
of struct proto.

So, the access to sk_prot->memory_pressure should not be changed.

Acked-by: Eric Dumazet <edumazet@google.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---

Resent because I fat fingered and deleted Dave by accident.

 include/net/sock.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index c93542f92420..e3a18ff0c38b 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1137,7 +1137,7 @@ static inline bool sk_under_memory_pressure(const struct sock *sk)
 	if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
 		return !!sk->sk_cgrp->memory_pressure;
 
-	return !!sk->sk_prot->memory_pressure;
+	return !!*sk->sk_prot->memory_pressure;
 }
 
 static inline void sk_leave_memory_pressure(struct sock *sk)
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure
  2013-10-23 19:55         ` [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure Eric W. Biederman
@ 2013-10-23 20:15           ` David Miller
  0 siblings, 0 replies; 11+ messages in thread
From: David Miller @ 2013-10-23 20:15 UTC (permalink / raw)
  To: ebiederm
  Cc: eric.dumazet, christoph.paasch, fengguang.wu, netdev, linux-kernel

From: ebiederm@xmission.com (Eric W. Biederman)
Date: Wed, 23 Oct 2013 12:55:18 -0700

> From: Christoph Paasch <christoph.paasch@uclouvain.be>
> Date: Wed, 23 Oct 2013 12:49:21 -0700
> 
> 2e685cad57 (tcp_memcontrol: Kill struct tcp_memcontrol) falsly modified
> the access to memory_pressure of sk->sk_prot->memory_pressure. The patch
> did modify the memory_pressure-field of struct cg_proto, but not the one
> of struct proto.
> 
> So, the access to sk_prot->memory_pressure should not be changed.
> 
> Acked-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>

Applied, but I replaced "Fix: " with "net: " in the commit header line.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol"
  2013-10-23 12:25     ` Christoph Paasch
  2013-10-23 13:02       ` Eric Dumazet
@ 2013-10-23 22:07       ` Fengguang Wu
  1 sibling, 0 replies; 11+ messages in thread
From: Fengguang Wu @ 2013-10-23 22:07 UTC (permalink / raw)
  To: Christoph Paasch; +Cc: Eric W. Biederman, David Miller, netdev, linux-kernel

> -       return !!sk->sk_prot->memory_pressure;
> +       return !!*sk->sk_prot->memory_pressure;

Good catch, Christoph! With no surprise, it restores the performance:

    a4fe34bf902b8f709c63      2e685cad57906e19add7      a235435d612680e595ea  
------------------------  ------------------------  ------------------------  
                  707.40       -41.0%       417.50        -8.8%       645.00  lkp-nex04/micro/netperf/120s-200%-TCP_STREAM
                 2775.60       -23.7%      2116.50        +2.1%      2834.00  lkp-sb03/micro/netperf/120s-200%-TCP_STREAM
                 3483.00       -27.2%      2534.00        -0.1%      3479.00  TOTAL netperf.Throughput_Mbps

It's a bit late, but

Tested-by: Fengguang Wu <fengguang.wu@intel.com>

Thanks,
Fengguang

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-10-23 22:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-22 21:41 -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol" fengguang.wu
2013-10-22 22:00 ` David Miller
2013-10-23  4:38   ` Eric W. Biederman
     [not found]     ` <20131023061019.GA15698@localhost>
2013-10-23  9:43       ` Eric W. Biederman
2013-10-23 11:46         ` Fengguang Wu
2013-10-23 12:25     ` Christoph Paasch
2013-10-23 13:02       ` Eric Dumazet
2013-10-23 19:55         ` [PATCH] Fix: Dereference pointer-value of sk_prot->memory_pressure Eric W. Biederman
2013-10-23 20:15           ` David Miller
2013-10-23 19:58         ` Eric W. Biederman
2013-10-23 22:07       ` -27% netperf TCP_STREAM regression by "tcp_memcontrol: Kill struct tcp_memcontrol" Fengguang Wu

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).