• Joel Fernandes (Google)'s avatar
    rcuperf: Add kfree_rcu() performance Tests · e6e78b00
    Joel Fernandes (Google) authored
    This test runs kfree_rcu() in a loop to measure performance of the new
    kfree_rcu() batching functionality.
    
    The following table shows results when booting with arguments:
    rcuperf.kfree_loops=20000 rcuperf.kfree_alloc_num=8000
    rcuperf.kfree_rcu_test=1 rcuperf.kfree_no_batch=X
    
    rcuperf.kfree_no_batch=X    # Grace Periods	Test Duration (s)
      X=1 (old behavior)              9133                 11.5
      X=0 (new behavior)              1732                 12.5
    
    On a 16 CPU system with the above boot parameters, we see that the total
    number of grace periods that elapse during the test drops from 9133 when
    not batching to 1732 when batching (a 5X improvement). The kfree_rcu()
    flood itself slows down a bit when batching, though, as shown.
    
    Note that the active memory consumption during the kfree_rcu() flood
    does increase to around 200-250MB due to the batching (from around 50MB
    without batching). However, this memory consumption is relatively
    constant. In other words, the system is able to keep up with the
    kfree_rcu() load. The memory consumption comes down considerably if
    KFREE_DRAIN_JIFFIES is increased from HZ/50 to HZ/80. A later patch will
    reduce memory consumption further by using multiple lists.
    
    Also, when running the test, please disable CONFIG_DEBUG_PREEMPT and
    CONFIG_PROVE_RCU for realistic comparisons with/without batching.
    Signed-off-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
    e6e78b00
rcuperf.c 21.2 KB