mm: lru related cleanups
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest10 patches 14 repliesIn review 7 of 10 applied
- v111 patches 15 repliesSuperseded
Changes in v2 from the cover letter
dropped the last patch in this series based on the discussion here:
https://lore.kernel.org/patchwork/patch/1350552/#1550430
Patches in v2 7 of 10 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | mm: use add_page_to_lru_list()mm/ | +1 | 2 replies | Applied |
| 2/10 | mm: shuffle lru list addition and deletion functionsinclude/ | +21 | 2 replies | Applied |
| 3/10 | mm: don't pass "enum lru_list" to lru list addition functionsinclude/ mm/ mm/ | +15 | 10 replies | |
| 4/10 | mm: don't pass "enum lru_list" to trace_mm_lru_insertion()include/ mm/ | +5 | 0 replies | |
| 5/10 | mm: don't pass "enum lru_list" to del_page_from_lru_list()include/ mm/ mm/ +2 more | +17 | 0 replies | |
| 6/10 | mm: add __clear_page_lru_flags() to replace page_off_lru()include/ mm/ mm/ | +13 | 0 replies | Applied |
| 7/10 | mm: VM_BUG_ON lru page flagsinclude/ mm/ mm/ | +4 | 0 replies | Applied |
| 8/10 | mm: fold page_lru_base_type() into its sole callerinclude/ | +6 | 0 replies | Applied |
| 9/10 | mm: fold __update_lru_size() into its sole callerinclude/ | +1 | 0 replies | Applied |
| 10/10 | mm: make lruvec_lru_size() staticinclude/ mm/ | +2 | 24 replies | Applied |
Reviews trailers per patch
6 of 10 patches have a Reviewed-by or Acked-by.
| Patch | Alex Shi | Vlastimil Babka | Miaohe Lin |
|---|---|---|---|
| 1/10 | R-b | A-b | R-b |
| 2/10 | A-b | R-b | |
| 3/10 | |||
| 4/10 | R-b | ||
| 5/10 | |||
| 6/10 | |||
| 7/10 | |||
| 8/10 | R-b | ||
| 9/10 | R-b | ||
| 10/10 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 00/10] mm: lru related cleanups
The cleanups are intended to reduce the verbosity in lru list operations and make them less error-prone. A typical example would be how the patches change __activate_page():
static void __activate_page(struct page *page, struct lruvec *lruvec) {
if (!PageActive(page) && !PageUnevictable(page)) {
- int lru = page_lru_base_type(page);
int nr_pages = thp_nr_pages(page);
- del_page_from_lru_list(page, lruvec, lru);
+ del_page_from_lru_list(page, lruvec);
SetPageActive(page);
- lru += LRU_ACTIVE;
- add_page_to_lru_list(page, lruvec, lru);
+ add_page_to_lru_list(page, lruvec);
trace_mm_lru_activate(page);
There are a few more places like __activate_page() and they are unnecessarily repetitive in terms of figuring out which list a page should be added onto or deleted from. And with the duplicated code removed, they are easier to read, IMO.
Patch 1 to 5 basically cover the above. Patch 6 and 7 make code more robust by improving bug reporting. Patch 8, 9 and 10 take care of some dangling helpers left in header files.
v1 -> v2:
dropped the last patch in this series based on the discussion here:
https://lore.kernel.org/patchwork/patch/1350552/#1550430
Yu Zhao (10):
mm: use add_page_to_lru_list()
mm: shuffle lru list addition and deletion functions
mm: don't pass "enum lru_list" to lru list addition functions
mm: don't pass "enum lru_list" to trace_mm_lru_insertion()
mm: don't pass "enum lru_list" to del_page_from_lru_list()
mm: add __clear_page_lru_flags() to replace page_off_lru()
mm: VM_BUG_ON lru page flags
mm: fold page_lru_base_type() into its sole caller
mm: fold __update_lru_size() into its sole caller
mm: make lruvec_lru_size() static
include/linux/mm_inline.h | 113 ++++++++++++++------------------- include/linux/mmzone.h | 2 - include/trace/events/pagemap.h | 11 ++-- mm/compaction.c | 2 +- mm/mlock.c | 3 +- mm/swap.c | 50 ++++++--------- mm/vmscan.c | 21 ++---- 7 files changed, 77 insertions(+), 125 deletions(-)
Signature · 1 line
2.30.0.280.ga3ce27912f-goog