Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cebe34e0 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm: reduce the time spend by killed tasks in alloc path"

parents 8e21ae55 d1b75390
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4339,6 +4339,9 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
	if (current->flags & PF_MEMALLOC)
		goto nopage;

	if (fatal_signal_pending(current) && !(gfp_mask & __GFP_NOFAIL))
		goto nopage;

	/* Try direct reclaim and then allocating */
	page = __alloc_pages_direct_reclaim(gfp_mask, order, alloc_flags, ac,
							&did_some_progress);
+4 −4
Original line number Diff line number Diff line
@@ -1970,13 +1970,13 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
		if (stalled)
			return 0;

		/* wait a bit for the reclaimer. */
		msleep(100);
		stalled = true;

		/* We are about to die and free our memory. Return now. */
		if (fatal_signal_pending(current))
			return SWAP_CLUSTER_MAX;

		/* wait a bit for the reclaimer. */
		msleep(100);
		stalled = true;
	}

	lru_add_drain();