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

Commit 9eb8c46c authored by Minchan Kim's avatar Minchan Kim Committed by Gerrit - the friendly Code Review server
Browse files

mm: Remove shrink_page



By previous patch, shrink_page_list can handle pages from
multiple zone so let's remove shrink_page.

Change-Id: I3526377aa6ee6142b8f3ec63396e7ada1e442505
Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
Patch-mainline: linux-mm @ 22 Apr 2013 17:45:03
[vinmenon@codeaurora.org: trivial merge conflict fixes]
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 7ff59069
Loading
Loading
Loading
Loading
+14 −31
Original line number Diff line number Diff line
@@ -1475,6 +1475,13 @@ static unsigned long shrink_page_list(struct list_head *page_list,
			(*get_compound_page_dtor(page))(page);
		} else
			list_add(&page->lru, &free_pages);
		/*
		 * If pagelist are from multiple nodes, we should decrease
		 * NR_ISOLATED_ANON + x on freed pages in here.
		 */
		if (!pgdat)
			dec_node_page_state(page, NR_ISOLATED_ANON +
					page_is_file_cache(page));
		continue;

activate_locked:
@@ -1545,26 +1552,6 @@ unsigned long reclaim_clean_pages_from_list(struct zone *zone,
}

#ifdef CONFIG_PROCESS_RECLAIM
static unsigned long shrink_page(struct page *page,
					struct zone *zone,
					struct scan_control *sc,
					enum ttu_flags ttu_flags,
					bool force_reclaim,
					struct list_head *ret_pages)
{
	int reclaimed;
	LIST_HEAD(page_list);

	list_add(&page->lru, &page_list);

	reclaimed = shrink_page_list(&page_list, zone->zone_pgdat, sc,
				ttu_flags, NULL, force_reclaim);
	if (!reclaimed)
		list_splice(&page_list, ret_pages);

	return reclaimed;
}

unsigned long reclaim_pages_from_list(struct list_head *page_list)
{
	struct scan_control sc = {
@@ -1575,21 +1562,17 @@ unsigned long reclaim_pages_from_list(struct list_head *page_list)
		.may_swap = 1,
	};

	LIST_HEAD(ret_pages);
	unsigned long nr_reclaimed;
	struct page *page;
	unsigned long nr_reclaimed = 0;

	while (!list_empty(page_list)) {
		page = lru_to_page(page_list);
		list_del(&page->lru);

	list_for_each_entry(page, page_list, lru)
		ClearPageActive(page);
		nr_reclaimed += shrink_page(page, page_zone(page), &sc,
			TTU_IGNORE_ACCESS, true, &ret_pages);
	}

	while (!list_empty(&ret_pages)) {
		page = lru_to_page(&ret_pages);
	nr_reclaimed = shrink_page_list(page_list, NULL, &sc,
			TTU_IGNORE_ACCESS, NULL, true);

	while (!list_empty(page_list)) {
		page = lru_to_page(page_list);
		list_del(&page->lru);
		dec_node_page_state(page, NR_ISOLATED_ANON +
				page_is_file_cache(page));