diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-11-11 16:22:27 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-11-11 16:22:27 -0300 |
commit | 29f5b648fa0b31ad614c78468b9279e5fa96397a (patch) | |
tree | 385e76324c4e95e90b16889937e7c24e6f7d4f4a /mm | |
parent | 1eae9639aac0f8de4d284f567ec722a822b52513 (diff) |
Linux-libre 4.8.7-gnupck-4.8.7-gnu
Diffstat (limited to 'mm')
-rw-r--r-- | mm/backing-dev.c | 1 | ||||
-rw-r--r-- | mm/list_lru.c | 2 | ||||
-rw-r--r-- | mm/memcontrol.c | 9 | ||||
-rw-r--r-- | mm/page-writeback.c | 1 | ||||
-rw-r--r-- | mm/slab.c | 2 | ||||
-rw-r--r-- | mm/vmscan.c | 2 |
6 files changed, 14 insertions, 3 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 3bfed5ab2..8fde443f3 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -310,7 +310,6 @@ static int wb_init(struct bdi_writeback *wb, struct backing_dev_info *bdi, spin_lock_init(&wb->work_lock); INIT_LIST_HEAD(&wb->work_list); INIT_DELAYED_WORK(&wb->dwork, wb_workfn); - wb->dirty_sleep = jiffies; wb->congested = wb_congested_get_create(bdi, blkcg_id, gfp); if (!wb->congested) diff --git a/mm/list_lru.c b/mm/list_lru.c index 1d05cb9d3..234676e31 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -554,6 +554,8 @@ int __list_lru_init(struct list_lru *lru, bool memcg_aware, err = memcg_init_list_lru(lru, memcg_aware); if (err) { kfree(lru->node); + /* Do this so a list_lru_destroy() doesn't crash: */ + lru->node = NULL; goto out; } diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4be518d4e..dddead146 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1947,6 +1947,15 @@ retry: current->flags & PF_EXITING)) goto force; + /* + * Prevent unbounded recursion when reclaim operations need to + * allocate memory. This might exceed the limits temporarily, + * but we prefer facilitating memory reclaim and getting back + * under the limit over triggering OOM kills in these cases. + */ + if (unlikely(current->flags & PF_MEMALLOC)) + goto force; + if (unlikely(task_in_memcg_oom(current))) goto nomem; diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 56be15224..1aeb51d24 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -1786,7 +1786,6 @@ pause: pause, start_time); __set_current_state(TASK_KILLABLE); - wb->dirty_sleep = now; io_schedule_timeout(pause); current->dirty_paused_when = now + pause; @@ -964,7 +964,7 @@ static int setup_kmem_cache_node(struct kmem_cache *cachep, * guaranteed to be valid until irq is re-enabled, because it will be * freed after synchronize_sched(). */ - if (force_change) + if (old_shared && force_change) synchronize_sched(); fail: diff --git a/mm/vmscan.c b/mm/vmscan.c index 0fe8b7113..ba0fad78e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3048,7 +3048,9 @@ unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *memcg, sc.gfp_mask, sc.reclaim_idx); + current->flags |= PF_MEMALLOC; nr_reclaimed = do_try_to_free_pages(zonelist, &sc); + current->flags &= ~PF_MEMALLOC; trace_mm_vmscan_memcg_reclaim_end(nr_reclaimed); |