Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge misc mm fixes from Andrew Morton:
"7 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
mm: memcontrol: fix percpu vmstats and vmevents flush
mm, memcg: do not set reclaim_state on soft limit reclaim
mailmap: add aliases for Dmitry Safonov
mm/z3fold.c: fix lock/unlock imbalance in z3fold_page_isolate
mm, memcg: partially revert "mm/memcontrol.c: keep local VM counters in sync with the hierarchical ones"
mm/zsmalloc.c: fix build when CONFIG_COMPACTION=n
mm: memcontrol: flush percpu slab vmstats on kmem offlining

+47 -22
+3
.mailmap
··· 64 64 Dengcheng Zhu <dzhu@wavecomp.com> <dczhu@mips.com> 65 65 Dengcheng Zhu <dzhu@wavecomp.com> <dengcheng.zhu@gmail.com> 66 66 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> 67 + Dmitry Safonov <0x7f454c46@gmail.com> <dsafonov@virtuozzo.com> 68 + Dmitry Safonov <0x7f454c46@gmail.com> <d.safonov@partner.samsung.com> 69 + Dmitry Safonov <0x7f454c46@gmail.com> <dima@arista.com> 67 70 Domen Puncer <domen@coderock.org> 68 71 Douglas Gilbert <dougg@torque.net> 69 72 Ed L. Cashin <ecashin@coraid.com>
+3 -2
include/linux/mmzone.h
··· 215 215 NR_INACTIVE_FILE, /* " " " " " */ 216 216 NR_ACTIVE_FILE, /* " " " " " */ 217 217 NR_UNEVICTABLE, /* " " " " " */ 218 - NR_SLAB_RECLAIMABLE, 219 - NR_SLAB_UNRECLAIMABLE, 218 + NR_SLAB_RECLAIMABLE, /* Please do not reorder this item */ 219 + NR_SLAB_UNRECLAIMABLE, /* and this one without looking at 220 + * memcg_flush_percpu_vmstats() first. */ 220 221 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */ 221 222 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */ 222 223 WORKINGSET_NODES,
+35 -18
mm/memcontrol.c
··· 752 752 /* Update memcg */ 753 753 __mod_memcg_state(memcg, idx, val); 754 754 755 + /* Update lruvec */ 756 + __this_cpu_add(pn->lruvec_stat_local->count[idx], val); 757 + 755 758 x = val + __this_cpu_read(pn->lruvec_stat_cpu->count[idx]); 756 759 if (unlikely(abs(x) > MEMCG_CHARGE_BATCH)) { 757 760 struct mem_cgroup_per_node *pi; 758 761 759 - /* 760 - * Batch local counters to keep them in sync with 761 - * the hierarchical ones. 762 - */ 763 - __this_cpu_add(pn->lruvec_stat_local->count[idx], x); 764 762 for (pi = pn; pi; pi = parent_nodeinfo(pi, pgdat->node_id)) 765 763 atomic_long_add(x, &pi->lruvec_stat[idx]); 766 764 x = 0; ··· 3258 3260 } 3259 3261 } 3260 3262 3261 - static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg) 3263 + static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg, bool slab_only) 3262 3264 { 3263 3265 unsigned long stat[MEMCG_NR_STAT]; 3264 3266 struct mem_cgroup *mi; 3265 3267 int node, cpu, i; 3268 + int min_idx, max_idx; 3266 3269 3267 - for (i = 0; i < MEMCG_NR_STAT; i++) 3270 + if (slab_only) { 3271 + min_idx = NR_SLAB_RECLAIMABLE; 3272 + max_idx = NR_SLAB_UNRECLAIMABLE; 3273 + } else { 3274 + min_idx = 0; 3275 + max_idx = MEMCG_NR_STAT; 3276 + } 3277 + 3278 + for (i = min_idx; i < max_idx; i++) 3268 3279 stat[i] = 0; 3269 3280 3270 3281 for_each_online_cpu(cpu) 3271 - for (i = 0; i < MEMCG_NR_STAT; i++) 3272 - stat[i] += raw_cpu_read(memcg->vmstats_percpu->stat[i]); 3282 + for (i = min_idx; i < max_idx; i++) 3283 + stat[i] += per_cpu(memcg->vmstats_percpu->stat[i], cpu); 3273 3284 3274 3285 for (mi = memcg; mi; mi = parent_mem_cgroup(mi)) 3275 - for (i = 0; i < MEMCG_NR_STAT; i++) 3286 + for (i = min_idx; i < max_idx; i++) 3276 3287 atomic_long_add(stat[i], &mi->vmstats[i]); 3288 + 3289 + if (!slab_only) 3290 + max_idx = NR_VM_NODE_STAT_ITEMS; 3277 3291 3278 3292 for_each_node(node) { 3279 3293 struct mem_cgroup_per_node *pn = memcg->nodeinfo[node]; 3280 3294 struct mem_cgroup_per_node *pi; 3281 3295 3282 - for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) 3296 + for (i = min_idx; i < max_idx; i++) 3283 3297 stat[i] = 0; 3284 3298 3285 3299 for_each_online_cpu(cpu) 3286 - for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) 3287 - stat[i] += raw_cpu_read( 3288 - pn->lruvec_stat_cpu->count[i]); 3300 + for (i = min_idx; i < max_idx; i++) 3301 + stat[i] += per_cpu( 3302 + pn->lruvec_stat_cpu->count[i], cpu); 3289 3303 3290 3304 for (pi = pn; pi; pi = parent_nodeinfo(pi, node)) 3291 - for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) 3305 + for (i = min_idx; i < max_idx; i++) 3292 3306 atomic_long_add(stat[i], &pi->lruvec_stat[i]); 3293 3307 } 3294 3308 } ··· 3316 3306 3317 3307 for_each_online_cpu(cpu) 3318 3308 for (i = 0; i < NR_VM_EVENT_ITEMS; i++) 3319 - events[i] += raw_cpu_read( 3320 - memcg->vmstats_percpu->events[i]); 3309 + events[i] += per_cpu(memcg->vmstats_percpu->events[i], 3310 + cpu); 3321 3311 3322 3312 for (mi = memcg; mi; mi = parent_mem_cgroup(mi)) 3323 3313 for (i = 0; i < NR_VM_EVENT_ITEMS; i++) ··· 3373 3363 if (!parent) 3374 3364 parent = root_mem_cgroup; 3375 3365 3366 + /* 3367 + * Deactivate and reparent kmem_caches. Then flush percpu 3368 + * slab statistics to have precise values at the parent and 3369 + * all ancestor levels. It's required to keep slab stats 3370 + * accurate after the reparenting of kmem_caches. 3371 + */ 3376 3372 memcg_deactivate_kmem_caches(memcg, parent); 3373 + memcg_flush_percpu_vmstats(memcg, true); 3377 3374 3378 3375 kmemcg_id = memcg->kmemcg_id; 3379 3376 BUG_ON(kmemcg_id < 0); ··· 4757 4740 * Flush percpu vmstats and vmevents to guarantee the value correctness 4758 4741 * on parent's and all ancestor levels. 4759 4742 */ 4760 - memcg_flush_percpu_vmstats(memcg); 4743 + memcg_flush_percpu_vmstats(memcg, false); 4761 4744 memcg_flush_percpu_vmevents(memcg); 4762 4745 for_each_node(node) 4763 4746 free_mem_cgroup_per_node_info(memcg, node);
+3 -2
mm/vmscan.c
··· 3220 3220 3221 3221 #ifdef CONFIG_MEMCG 3222 3222 3223 + /* Only used by soft limit reclaim. Do not reuse for anything else. */ 3223 3224 unsigned long mem_cgroup_shrink_node(struct mem_cgroup *memcg, 3224 3225 gfp_t gfp_mask, bool noswap, 3225 3226 pg_data_t *pgdat, ··· 3236 3235 }; 3237 3236 unsigned long lru_pages; 3238 3237 3239 - set_task_reclaim_state(current, &sc.reclaim_state); 3238 + WARN_ON_ONCE(!current->reclaim_state); 3239 + 3240 3240 sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) | 3241 3241 (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK); 3242 3242 ··· 3255 3253 3256 3254 trace_mm_vmscan_memcg_softlimit_reclaim_end(sc.nr_reclaimed); 3257 3255 3258 - set_task_reclaim_state(current, NULL); 3259 3256 *nr_scanned = sc.nr_scanned; 3260 3257 3261 3258 return sc.nr_reclaimed;
+1
mm/z3fold.c
··· 1406 1406 * should freak out. 1407 1407 */ 1408 1408 WARN(1, "Z3fold is experiencing kref problems\n"); 1409 + z3fold_page_unlock(zhdr); 1409 1410 return false; 1410 1411 } 1411 1412 z3fold_page_unlock(zhdr);
+2
mm/zsmalloc.c
··· 2412 2412 if (!pool->name) 2413 2413 goto err; 2414 2414 2415 + #ifdef CONFIG_COMPACTION 2415 2416 init_waitqueue_head(&pool->migration_wait); 2417 + #endif 2416 2418 2417 2419 if (create_cache(pool)) 2418 2420 goto err;