Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit cb35f8b

Browse files
committed
mm/vmscan: vm.workingset_protection: Update to linux6.9-le9uo-1.6
Signed-off-by: Alexandre Frade <[email protected]>
1 parent ee4bdd6 commit cb35f8b

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

mm/mm_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2749,7 +2749,7 @@ static void __init mem_init_print_info(void)
27492749
, K(totalhigh_pages())
27502750
#endif
27512751
);
2752-
printk(KERN_INFO "le9 Unofficial (le9uo) working set protection 1.5 by Masahito Suzuki (forked from hakavlad's original le9 patch)");
2752+
printk(KERN_INFO "le9 Unofficial (le9uo) working set protection 1.6 by Masahito Suzuki (forked from hakavlad's original le9 patch)");
27532753
}
27542754

27552755
/*

mm/vmscan.c

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3962,23 +3962,6 @@ static bool lruvec_is_reclaimable(struct lruvec *lruvec, struct scan_control *sc
39623962
/* to protect the working set of the last N jiffies */
39633963
static unsigned long lru_gen_min_ttl __read_mostly;
39643964

3965-
static void do_invoke_oom(struct scan_control *sc, bool try_memcg) {
3966-
struct oom_control oc = {
3967-
.gfp_mask = sc->gfp_mask,
3968-
.order = sc->order,
3969-
};
3970-
3971-
if (try_memcg && mem_cgroup_oom_synchronize(true))
3972-
return;
3973-
3974-
if (!mutex_trylock(&oom_lock))
3975-
return;
3976-
out_of_memory(&oc);
3977-
mutex_unlock(&oom_lock);
3978-
}
3979-
#define invoke_oom(sc) do_invoke_oom(sc, true)
3980-
#define invoke_oom_nomemcg(sc) do_invoke_oom(sc, false)
3981-
39823965
static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc)
39833966
{
39843967
struct mem_cgroup *memcg;
@@ -4007,7 +3990,15 @@ static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc)
40073990
* younger than min_ttl. However, another possibility is all memcgs are
40083991
* either too small or below min.
40093992
*/
4010-
invoke_oom_nomemcg(sc);
3993+
if (mutex_trylock(&oom_lock)) {
3994+
struct oom_control oc = {
3995+
.gfp_mask = sc->gfp_mask,
3996+
};
3997+
3998+
out_of_memory(&oc);
3999+
4000+
mutex_unlock(&oom_lock);
4001+
}
40114002
}
40124003

40134004
int vm_workingset_protection_update_handler(struct ctl_table *table, int write,
@@ -4599,7 +4590,7 @@ static int isolate_folios(struct lruvec *lruvec, struct scan_control *sc, int sw
45994590
*/
46004591
if (!swappiness)
46014592
type = LRU_GEN_FILE;
4602-
else if (sc->clean_below_min || sc->clean_below_low)
4593+
else if (sc->clean_below_low || sc->clean_below_min)
46034594
type = LRU_GEN_ANON;
46044595
else if (min_seq[LRU_GEN_ANON] < min_seq[LRU_GEN_FILE])
46054596
type = LRU_GEN_ANON;
@@ -4610,7 +4601,7 @@ static int isolate_folios(struct lruvec *lruvec, struct scan_control *sc, int sw
46104601
else
46114602
type = get_type_to_scan(lruvec, swappiness, &tier);
46124603

4613-
for (i = 0; i < ANON_AND_FILE; i++) {
4604+
for (i = !swappiness; i < ANON_AND_FILE; i++) {
46144605
if (tier < 0)
46154606
tier = get_tier_idx(lruvec, type);
46164607

@@ -6129,8 +6120,6 @@ static void shrink_node(pg_data_t *pgdat, struct scan_control *sc)
61296120
*/
61306121
if (reclaimable)
61316122
pgdat->kswapd_failures = 0;
6132-
else if (sc->clean_below_min && !sc->priority)
6133-
invoke_oom(sc);
61346123
}
61356124

61366125
/*

0 commit comments

Comments
 (0)