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

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

Merge "ion: Consider ion pool pages as indirectly reclaimable"

parents 07b47619 013bf399
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@ static int ion_page_pool_add(struct ion_page_pool *pool, struct page *page)
		list_add_tail(&page->lru, &pool->low_items);
		pool->low_count++;
	}

	mod_node_page_state(page_pgdat(page), NR_INDIRECTLY_RECLAIMABLE_BYTES,
			    (1 << (PAGE_SHIFT + pool->order)));
	mutex_unlock(&pool->mutex);
	return 0;
}
@@ -67,6 +70,8 @@ static struct page *ion_page_pool_remove(struct ion_page_pool *pool, bool high)
	}

	list_del(&page->lru);
	mod_node_page_state(page_pgdat(page), NR_INDIRECTLY_RECLAIMABLE_BYTES,
			    -(1 << (PAGE_SHIFT + pool->order)));
	return page;
}

+1 −0
Original line number Diff line number Diff line
@@ -180,6 +180,7 @@ enum node_stat_item {
	NR_VMSCAN_IMMEDIATE,	/* Prioritise for reclaim when writeback ends */
	NR_DIRTIED,		/* page dirtyings since bootup */
	NR_WRITTEN,		/* page writings since bootup */
	NR_INDIRECTLY_RECLAIMABLE_BYTES, /* measured in bytes */
	NR_VM_NODE_STAT_ITEMS
};

+7 −0
Original line number Diff line number Diff line
@@ -4558,6 +4558,13 @@ long si_mem_available(void)
		     min(global_node_page_state(NR_SLAB_RECLAIMABLE) / 2,
			 wmark_low);

	/*
	 * Part of the kernel memory, which can be released under memory
	 * pressure.
	 */
	available += global_node_page_state(NR_INDIRECTLY_RECLAIMABLE_BYTES) >>
		PAGE_SHIFT;

	if (available < 0)
		available = 0;
	return available;
+7 −0
Original line number Diff line number Diff line
@@ -635,6 +635,13 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
		 */
		free += global_node_page_state(NR_SLAB_RECLAIMABLE);

		/*
		 * Part of the kernel memory, which can be released
		 * under memory pressure.
		 */
		free += global_node_page_state(
			NR_INDIRECTLY_RECLAIMABLE_BYTES) >> PAGE_SHIFT;

		/*
		 * Leave reserved pages. The pages are not for anonymous pages.
		 */
+1 −0
Original line number Diff line number Diff line
@@ -1090,6 +1090,7 @@ const char * const vmstat_text[] = {
	"nr_vmscan_immediate_reclaim",
	"nr_dirtied",
	"nr_written",
	"nr_indirectly_reclaimable",

	/* enum writeback_stat_item counters */
	"nr_dirty_threshold",