Unverified Commit af9eaea2 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1804 count time in drain_all_pages during direct reclaim as memory pressure

parents ed653dc2 e39ad8a4
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -4417,13 +4417,12 @@ __perform_reclaim(gfp_t gfp_mask, unsigned int order,
					const struct alloc_context *ac)
{
	unsigned int noreclaim_flag;
	unsigned long pflags, progress;
	unsigned long progress;

	cond_resched();

	/* We now go into synchronous reclaim */
	cpuset_memory_pressure_bump();
	psi_memstall_enter(&pflags);
	fs_reclaim_acquire(gfp_mask);
	noreclaim_flag = memalloc_noreclaim_save();

@@ -4432,7 +4431,6 @@ __perform_reclaim(gfp_t gfp_mask, unsigned int order,

	memalloc_noreclaim_restore(noreclaim_flag);
	fs_reclaim_release(gfp_mask);
	psi_memstall_leave(&pflags);

	cond_resched();

@@ -4446,11 +4444,13 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
		unsigned long *did_some_progress)
{
	struct page *page = NULL;
	unsigned long pflags;
	bool drained = false;

	psi_memstall_enter(&pflags);
	*did_some_progress = __perform_reclaim(gfp_mask, order, ac);
	if (unlikely(!(*did_some_progress)))
		return NULL;
		goto out;

retry:
	page = get_page_from_freelist(gfp_mask, order, alloc_flags, ac);
@@ -4466,6 +4466,8 @@ __alloc_pages_direct_reclaim(gfp_t gfp_mask, unsigned int order,
		drained = true;
		goto retry;
	}
out:
	psi_memstall_leave(&pflags);

	return page;
}