Skip to content
Permalink
Branch: master
Commits on Nov 6, 2019
  1. simple_lmk: Increase default minfree value

    kerneltoast committed Nov 6, 2019
    After commit "simple_lmk: Make reclaim deterministic", Simple LMK's
    behavior changed and thus requires some slight re-tuning to make it work
    well again.
    
    Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Commits on Nov 5, 2019
  1. simple_lmk: Clean up some code style nitpicks

    kerneltoast committed Nov 4, 2019
    Using a parameter to pass around a unmodified pointer to a global
    variable is crufty; just use the `victims` variable directly instead.
    Also, compress the code in simple_lmk_init_set() a bit to make it look
    cleaner.
    
    Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Commits on Nov 4, 2019
  1. simple_lmk: Make reclaim deterministic

    kerneltoast committed Nov 4, 2019
    The 20 ms delay in the reclaim thread is a hacky fudge factor that can
    cause Simple LMK to behave wildly differently depending on the
    circumstances of when it is invoked. When kswapd doesn't get enough CPU
    time to finish up and go back to sleep within 20 ms, Simple LMK performs
    superfluous reclaims.
    
    This is suboptimal, so make Simple LMK more deterministic by eliminating
    the delay and instead queuing up reclaim requests from kswapd.
    
    Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
  2. simple_lmk: Fix broken multicopy atomicity for victims_to_kill

    kerneltoast committed Nov 4, 2019
    When the reclaim thread writes to victims_to_kill on one CPU, it expects
    the updated value to be immediately reflected on all CPUs in order for
    simple_lmk_mm_freed() to work correctly. Due to the lack of memory
    barriers to guarantee multicopy atomicity, simple_lmk_mm_freed() can be
    given a victim's mm without knowing the correct victims_to_kill value,
    which can cause the reclaim thread to remain stuck waiting forever for
    all victims to be freed. This scenario, despite being rare, has been
    observed.
    
    Fix this by using proper atomic helpers with memory barriers.
    
    Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
  3. Revert "simple_lmk: Add support for kernels older than 3.14"

    kerneltoast committed Nov 4, 2019
    This reverts commit 34f4988.
    
    Some multicopy-atomic helpers will be used which aren't present in
    kernels older than 3.14, so drop support for them.
    
    Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
You can’t perform that action at this time.