# git rev-parse -q --verify 1b4e3f26f9f7553b260b8aed43967500961448a6^{commit} # git fetch -q -n -f git://fs.ozlabs.ibm.com/kernel/linus master # git rev-parse -q --verify 1b4e3f26f9f7553b260b8aed43967500961448a6^{commit} 1b4e3f26f9f7553b260b8aed43967500961448a6 # git checkout -q -f -B kisskb 1b4e3f26f9f7553b260b8aed43967500961448a6 # git clean -qxdf # < git log -1 # commit 1b4e3f26f9f7553b260b8aed43967500961448a6 # Author: Mel Gorman # Date: Thu Dec 2 15:06:14 2021 +0000 # # mm: vmscan: Reduce throttling due to a failure to make progress # # Mike Galbraith, Alexey Avramov and Darrick Wong all reported similar # problems due to reclaim throttling for excessive lengths of time. In # Alexey's case, a memory hog that should go OOM quickly stalls for # several minutes before stalling. In Mike and Darrick's cases, a small # memcg environment stalled excessively even though the system had enough # memory overall. # # Commit 69392a403f49 ("mm/vmscan: throttle reclaim when no progress is # being made") introduced the problem although commit a19594ca4a8b # ("mm/vmscan: increase the timeout if page reclaim is not making # progress") made it worse. Systems at or near an OOM state that cannot # be recovered must reach OOM quickly and memcg should kill tasks if a # memcg is near OOM. # # To address this, only stall for the first zone in the zonelist, reduce # the timeout to 1 tick for VMSCAN_THROTTLE_NOPROGRESS and only stall if # the scan control nr_reclaimed is 0, kswapd is still active and there # were excessive pages pending for writeback. If kswapd has stopped # reclaiming due to excessive failures, do not stall at all so that OOM # triggers relatively quickly. Similarly, if an LRU is simply congested, # only lightly throttle similar to NOPROGRESS. # # Alexey's original case was the most straight forward # # for i in {1..3}; do tail /dev/zero; done # # On vanilla 5.16-rc1, this test stalled heavily, after the patch the test # completes in a few seconds similar to 5.15. # # Alexey's second test case added watching a youtube video while tail runs # 10 times. On 5.15, playback only jitters slightly, 5.16-rc1 stalls a # lot with lots of frames missing and numerous audio glitches. With this # patch applies, the video plays similarly to 5.15. # # [lkp@intel.com: Fix W=1 build warning] # # Link: https://lore.kernel.org/r/99e779783d6c7fce96448a3402061b9dc1b3b602.camel@gmx.de # Link: https://lore.kernel.org/r/20211124011954.7cab9bb4@mail.inbox.lv # Link: https://lore.kernel.org/r/20211022144651.19914-1-mgorman@techsingularity.net # Link: https://lore.kernel.org/r/20211202150614.22440-1-mgorman@techsingularity.net # Link: https://linux-regtracking.leemhuis.info/regzbot/regression/20211124011954.7cab9bb4@mail.inbox.lv/ # Reported-and-tested-by: Alexey Avramov # Reported-and-tested-by: Mike Galbraith # Reported-and-tested-by: Darrick J. Wong # Reported-by: kernel test robot # Acked-by: Hugh Dickins # Tracked-by: Thorsten Leemhuis # Fixes: 69392a403f49 ("mm/vmscan: throttle reclaim when no progress is being made") # Signed-off-by: Mel Gorman # Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc --version # < /opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version # < git log --format=%s --max-count=1 1b4e3f26f9f7553b260b8aed43967500961448a6 # < make -s -j 80 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- randconfig # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_CPU_BIG_ENDIAN=y # Added to kconfig CONFIG_PPC64=y # Added to kconfig CONFIG_PPC_DISABLE_WERROR=y # Added to kconfig CONFIG_SECTION_MISMATCH_WARN_ONLY=y # Added to kconfig CONFIG_PREVENT_FIRMWARE_BUILD=y # Added to kconfig CONFIG_CC_STACKPROTECTOR_STRONG=n # Added to kconfig CONFIG_GCC_PLUGINS=n # Added to kconfig CONFIG_LD_HEAD_STUB_CATCH=y # Added to kconfig CONFIG_TRIM_UNUSED_KSYMS=n # Added to kconfig CONFIG_UBSAN=n # < make -s -j 80 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- help # make -s -j 80 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- olddefconfig .config:4396:warning: override: reassigning to symbol PPC64 .config:4397:warning: override: reassigning to symbol PPC_DISABLE_WERROR .config:4399:warning: override: reassigning to symbol PREVENT_FIRMWARE_BUILD .config:4404:warning: override: reassigning to symbol UBSAN # make -s -j 80 ARCH=powerpc O=/kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 CROSS_COMPILE=/opt/cross/kisskb/korg/gcc-9.2.0-nolibc/powerpc64-linux/bin/powerpc64-linux- Completed OK # rm -rf /kisskb/build/linus-rand_powerpc-randconfig_powerpc-gcc9 # Build took: 0:07:01.989074