Merge "mm: reduce the time spend by killed tasks in alloc path"
This commit is contained in:
commit
cebe34e0bf
2 changed files with 7 additions and 4 deletions
|
@ -4339,6 +4339,9 @@ retry:
|
||||||
if (current->flags & PF_MEMALLOC)
|
if (current->flags & PF_MEMALLOC)
|
||||||
goto nopage;
|
goto nopage;
|
||||||
|
|
||||||
|
if (fatal_signal_pending(current) && !(gfp_mask & __GFP_NOFAIL))
|
||||||
|
goto nopage;
|
||||||
|
|
||||||
/* Try direct reclaim and then allocating */
|
/* Try direct reclaim and then allocating */
|
||||||
page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac,
|
page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac,
|
||||||
&did_some_progress);
|
&did_some_progress);
|
||||||
|
|
|
@ -1970,13 +1970,13 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
|
||||||
if (stalled)
|
if (stalled)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* wait a bit for the reclaimer. */
|
|
||||||
msleep(100);
|
|
||||||
stalled = true;
|
|
||||||
|
|
||||||
/* We are about to die and free our memory. Return now. */
|
/* We are about to die and free our memory. Return now. */
|
||||||
if (fatal_signal_pending(current))
|
if (fatal_signal_pending(current))
|
||||||
return SWAP_CLUSTER_MAX;
|
return SWAP_CLUSTER_MAX;
|
||||||
|
|
||||||
|
/* wait a bit for the reclaimer. */
|
||||||
|
msleep(100);
|
||||||
|
stalled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
lru_add_drain();
|
lru_add_drain();
|
||||||
|
|
Loading…
Reference in a new issue