[rlc-8] mm: scrape LRU pages for offlined memcgs#727
Closed
bmastbergen wants to merge 1 commit intorlc-8/4.18.0-553.83.1.el8_10from
Closed
[rlc-8] mm: scrape LRU pages for offlined memcgs#727bmastbergen wants to merge 1 commit intorlc-8/4.18.0-553.83.1.el8_10from
bmastbergen wants to merge 1 commit intorlc-8/4.18.0-553.83.1.el8_10from
Conversation
jira KERNEL-172
feature Add ability to scrape LRU pages from offlined memcgs
commit-author Yu Zhao <yuzhao@google.com>
commit-source v1-0001-mm-scrape-LRU-pages-for-offlined-memcgs.patch
commit-source-path Provided by Google Engineering
upstream-diff A few tweaks to the original patch were necessary:
* Removed unused nid variable from scrape_offlined_memcgs
* Switched extra2 to 8 (otherwise 'echo 8 > /proc/sys/vm/drop_caches'
would be rejected)
* Renamed nr_pages_to_scrape to offlined_memcg_nr_pages in the
!CONFIG_MEMCG case to match the CONFIG_MEMCG case
* Added 'return 0' to scrape_offlined_memcgs in the
!CONFIG_MEMCG case
For offlined memcgs, kmem (slab) is reparented so that it does not hold
refcnts which would in turn prevent those memcgs from being released.
However, reparenting does not apply to LRU pages (pagecache), and
therefore they need to be scraped as well for offlined memcgs.
"echo 8 > /proc/sys/vm/drop_caches" was introduced for this reason. And
unlike "echo 1", it does not have performance impact on online memcgs in
terms of zapping pagecache.
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
Collaborator
Author
|
Customer decided they don't actually want this change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change came as a patch from Google. It is not upstream as there is still ongoing work to fix this issue in the upstream https://lore.kernel.org/linux-mm/20250415024532.26632-1-songmuchun@bytedance.com/. This patch is a stopgap until the upstream solution is ready. I had to make a few tweaks to the supplied patch, which I have mentioned in the upstream-diff section of the commit message.
Original patch:
v1-0001-mm-scrape-LRU-pages-for-offlined-memcgs.patch
Build Log
Testing
Verified that 8 is now an accepted value to /proc/sys/vm/drop_caches. Also did a build with some debug to ensure scrape_offlined_memcgs was actually being called.
Also did normal smoke testing
selftest-4.18.0-553.16.1.el8_10.ciqfips.0.14.1.x86_64-1.log
selftest-4.18.0-bmastbergen_rlc-8_4.18.0-553.83.1.el8_10_KERNEL-172-9+-1.log