04 Sep, 2021

1 commit

  • In order to simulate different fixed sizes for vmalloc allocation
    introduce a new parameter that sets number of pages to be allocated for
    the "fix_size_alloc_test" test.

    By default 1 page is used unless a different number is specified over the
    new parameter.

    Link: https://lkml.kernel.org/r/20210710194151.21370-1-urezki@gmail.com
    Signed-off-by: Uladzislau Rezki (Sony)
    Cc: Mel Gorman
    Cc: Christoph Hellwig
    Cc: Matthew Wilcox
    Cc: Nicholas Piggin
    Cc: Hillf Danton
    Cc: Michal Hocko
    Cc: Oleksiy Avramchenko
    Cc: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uladzislau Rezki (Sony)
     

01 May, 2021

2 commits

  • By using this parameter we can specify how many workers are created to
    perform vmalloc tests. By default it is one CPU. The maximum value is
    set to 1024.

    As a result of this change a 'single_cpu_test' one becomes obsolete,
    therefore it is no longer needed.

    [urezki@gmail.com: extend max value of nr_threads parameter]
    Link: https://lkml.kernel.org/r/20210406124536.19658-1-urezki@gmail.com

    Link: https://lkml.kernel.org/r/20210402202237.20334-2-urezki@gmail.com
    Signed-off-by: Uladzislau Rezki (Sony)
    Cc: Hillf Danton
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Oleksiy Avramchenko
    Cc: Shuah Khan
    Cc: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uladzislau Rezki (Sony)
     
  • Remove two test cases related to kvfree_rcu() and SLAB. Those are
    considered as redundant now, because similar test functionality has
    recently been introduced in the "rcuscale" RCU test-suite.

    Link: https://lkml.kernel.org/r/20210402202237.20334-1-urezki@gmail.com
    Signed-off-by: Uladzislau Rezki (Sony)
    Cc: Hillf Danton
    Cc: Michal Hocko
    Cc: Matthew Wilcox
    Cc: Oleksiy Avramchenko
    Cc: Steven Rostedt
    Cc: Shuah Khan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uladzislau Rezki (Sony)
     

30 Jun, 2020

1 commit

  • Introduce four new test cases for testing the kvfree_rcu()
    interface. Two of them belong to single argument functionality
    and another two for 2-argument functionality.

    The aim is to stress and check how kvfree_rcu() behaves under
    different load and memory conditions and analyze its performance
    throughput.

    Reviewed-by: Joel Fernandes (Google)
    Signed-off-by: Uladzislau Rezki (Sony)
    Signed-off-by: Paul E. McKenney

    Uladzislau Rezki (Sony)
     

03 Jun, 2020

1 commit

  • No need to export the very low-level __vmalloc_node_range when the test
    module can use a slightly higher level variant.

    [akpm@linux-foundation.org: add missing `node' arg]
    [akpm@linux-foundation.org: fix riscv nommu build]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Acked-by: Peter Zijlstra (Intel)
    Cc: Christian Borntraeger
    Cc: Christophe Leroy
    Cc: Daniel Vetter
    Cc: David Airlie
    Cc: Gao Xiang
    Cc: Greg Kroah-Hartman
    Cc: Haiyang Zhang
    Cc: Johannes Weiner
    Cc: "K. Y. Srinivasan"
    Cc: Laura Abbott
    Cc: Mark Rutland
    Cc: Michael Kelley
    Cc: Minchan Kim
    Cc: Nitin Gupta
    Cc: Robin Murphy
    Cc: Sakari Ailus
    Cc: Stephen Hemminger
    Cc: Sumit Semwal
    Cc: Wei Liu
    Cc: Benjamin Herrenschmidt
    Cc: Catalin Marinas
    Cc: Heiko Carstens
    Cc: Paul Mackerras
    Cc: Vasily Gorbik
    Cc: Will Deacon
    Link: http://lkml.kernel.org/r/20200414131348.444715-26-hch@lst.de
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

15 May, 2019

1 commit

  • Local 'ret' is unneeded and was poorly named: the variable `ret'
    generally means the "the value which this function will return".

    Cc: Roman Gushchin
    Cc: Uladzislau Rezki
    Cc: Michal Hocko
    Cc: Matthew Wilcox
    Cc: Thomas Garnier
    Cc: Oleksiy Avramchenko
    Cc: Steven Rostedt
    Cc: Joel Fernandes
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

27 Apr, 2019

1 commit

  • On my "Intel(R) Xeon(R) W-2135 CPU @ 3.70GHz" system(12 CPUs) i get the
    warning from the compiler about frame size:

    warning: the frame size of 1096 bytes is larger than 1024 bytes [-Wframe-larger-than=]

    the size of cpumask_t depends on number of CPUs, therefore just make use
    of cpumask_of() in set_cpus_allowed_ptr() as a second argument.

    Link: http://lkml.kernel.org/r/20190418193925.9361-1-urezki@gmail.com
    Signed-off-by: Uladzislau Rezki (Sony)
    Reviewed-by: Andrew Morton
    Reviewed-by: Roman Gushchin
    Cc: Uladzislau Rezki
    Cc: Michal Hocko
    Cc: Matthew Wilcox
    Cc: Thomas Garnier
    Cc: Oleksiy Avramchenko
    Cc: Steven Rostedt
    Cc: Joel Fernandes
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uladzislau Rezki (Sony)
     

06 Mar, 2019

1 commit

  • This adds a new kernel module for analysis of vmalloc allocator. It is
    only enabled as a module. There are two main reasons this module should
    be used for: performance evaluation and stressing of vmalloc subsystem.

    It consists of several test cases. As of now there are 8. The module
    has five parameters we can specify to change its the behaviour.

    1) run_test_mask - set of tests to be run

    id: 1, name: fix_size_alloc_test
    id: 2, name: full_fit_alloc_test
    id: 4, name: long_busy_list_alloc_test
    id: 8, name: random_size_alloc_test
    id: 16, name: fix_align_alloc_test
    id: 32, name: random_size_align_alloc_test
    id: 64, name: align_shift_alloc_test
    id: 128, name: pcpu_alloc_test

    By default all tests are in run test mask. If you want to select some
    specific tests it is possible to pass the mask. For example for first,
    second and fourth tests we go 11 value.

    2) test_repeat_count - how many times each test should be repeated
    By default it is one time per test. It is possible to pass any number.
    As high the value is the test duration gets increased.

    3) test_loop_count - internal test loop counter. By default it is set
    to 1000000.

    4) single_cpu_test - use one CPU to run the tests
    By default this parameter is set to false. It means that all online
    CPUs execute tests. By setting it to 1, the tests are executed by
    first online CPU only.

    5) sequential_test_order - run tests in sequential order
    By default this parameter is set to false. It means that before running
    tests the order is shuffled. It is possible to make it sequential, just
    set it to 1.

    Performance analysis:
    In order to evaluate performance of vmalloc allocations, usually it
    makes sense to use only one CPU that runs tests, use sequential order,
    number of repeat tests can be different as well as set of test mask.

    For example if we want to run all tests, to use one CPU and repeat each
    test 3 times. Insert the module passing following parameters:

    single_cpu_test=1 sequential_test_order=1 test_repeat_count=3

    with following output:

    Summary: fix_size_alloc_test passed: 3 failed: 0 repeat: 3 loops: 1000000 avg: 901177 usec
    Summary: full_fit_alloc_test passed: 3 failed: 0 repeat: 3 loops: 1000000 avg: 1039341 usec
    Summary: long_busy_list_alloc_test passed: 3 failed: 0 repeat: 3 loops: 1000000 avg: 11775763 usec
    Summary: random_size_alloc_test passed 3: failed: 0 repeat: 3 loops: 1000000 avg: 6081992 usec
    Summary: fix_align_alloc_test passed: 3 failed: 0 repeat: 3, loops: 1000000 avg: 2003712 usec
    Summary: random_size_align_alloc_test passed: 3 failed: 0 repeat: 3 loops: 1000000 avg: 2895689 usec
    Summary: align_shift_alloc_test passed: 0 failed: 3 repeat: 3 loops: 1000000 avg: 573 usec
    Summary: pcpu_alloc_test passed: 3 failed: 0 repeat: 3 loops: 1000000 avg: 95802 usec
    All test took CPU0=192945605995 cycles

    The align_shift_alloc_test is expected to be failed.

    Stressing:
    In order to stress the vmalloc subsystem we run all available test cases
    on all available CPUs simultaneously. In order to prevent constant behaviour
    pattern, the test cases array is shuffled by default to randomize the order
    of test execution.

    For example if we want to run all tests(default), use all online CPUs(default)
    with shuffled order(default) and to repeat each test 30 times. The command
    would be like:

    modprobe vmalloc_test test_repeat_count=30

    Expected results are the system is alive, there are no any BUG_ONs or Kernel
    Panics the tests are completed, no memory leaks.

    [urezki@gmail.com: fix 32-bit builds]
    Link: http://lkml.kernel.org/r/20190106214839.ffvjvmrn52uqog7k@pc636
    [urezki@gmail.com: make CONFIG_TEST_VMALLOC depend on CONFIG_MMU]
    Link: http://lkml.kernel.org/r/20190219085441.s6bg2gpy4esny5vw@pc636
    Link: http://lkml.kernel.org/r/20190103142108.20744-3-urezki@gmail.com
    Signed-off-by: Uladzislau Rezki (Sony)
    Cc: Kees Cook
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Oleksiy Avramchenko
    Cc: Shuah Khan
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uladzislau Rezki (Sony)