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

Commit 94aff956 authored by Minchan Kim's avatar Minchan Kim Committed by Pranav Vashi
Browse files

mm: filter out compound page on per-process reclaim



We don't handle any compound page attached to page table
so filter it out.

[ 2639.685100] c2   8869 trying to isolate tail page
[ 2639.685102] c2   8869 ------------[ cut here ]------------
[ 2639.685108] c2   8869 WARNING: CPU: 2 PID: 8869 at /usr/local/google/home/minchan/nvme/bc-kernel/private/msm-google/mm/vmscan.c:1636 isolate_lru_page+0x238/0x248
[ 2639.685123] c2   8869 Modules linked in: sec_touch heatmap videobuf2_vmalloc videobuf2_memops snd_soc_sdm845 snd_soc_cs35l36 snd_soc_wcd_spi snd_soc_wcd934x snd_soc_wcd9xxx wcd_dsp_glink wcd_core pinctrl_wcd wlan(O)
[ 2639.685127] c2   8869 CPU: 2 PID: 8869 Comm: sh Tainted: G        W  O    4.9.124-665644-g6bb3e72d4673_audio-g3dce958 #19
[ 2639.685129] c2   8869 Hardware name: Google Inc. MSM sdm845 C1 DVT1.1 (DT)
[ 2639.685132] c2   8869 task: ffffffdd6a99e900 task.stack: ffffffdde8c74000
[ 2639.685135] c2   8869 PC is at isolate_lru_page+0x238/0x248
[ 2639.685138] c2   8869 LR is at isolate_lru_page+0x238/0x248
[ 2639.685141] c2   8869 pc : [<ffffff88631da1c0>] lr : [<ffffff88631da1c0>] pstate: 60400145
[ 2639.685142] c2   8869 sp : ffffffdde8c77b20
[ 2639.685145] c2   8869 x29: ffffffdde8c77b20 x28: ffffffddad771ed0
[ 2639.685148] c2   8869 x27: ffffffddde7882f8 x26: ffffffbf77c4fe80
[ 2639.685152] c2   8869 x25: ffffffdde8c77bd8 x24: ffffffdde9cd2840
[ 2639.685155] c2   8869 x23: 0000000000000000 x22: ffffffbf76b5dc70
[ 2639.685158] c2   8869 x21: ffffffdde8c77d08 x20: 00000000cc000000
[ 2639.685161] c2   8869 x19: ffffffbf77c4fe80 x18: 0000007a14e32000
[ 2639.685164] c2   8869 x17: 4000000000000000 x16: 0000000000000000
[ 2639.685167] c2   8869 x15: 0000000000000178 x14: 2be2cf1bbc25f200
[ 2639.685170] c2   8869 x13: ffffffdde8c77b20 x12: ffffffdde8c77b20
[ 2639.685173] c2   8869 x11: ffffffdde8c77b20 x10: ffffffdde8c77b20
[ 2639.685176] c2   8869 x9 : ffffffdde8c77ae0 x8 : 70206c6961742065
[ 2639.685179] c2   8869 x7 : 74616c6f7369206f x6 : ffffff886553cc88
[ 2639.685182] c2   8869 x5 : 0000000000000015 x4 : 0000000000000000
[ 2639.685185] c2   8869 x3 : 0000000000000140 x2 : 2be2cf1bbc25f200
[ 2639.685188] c2   8869 x1 : 2be2cf1bbc25f200 x0 : 000000000000001b

Bug: 119789589
Change-Id: Ib104c94722255c006e9fc78af24f913afdf59591
Signed-off-by: default avatarMinchan Kim <minchan@google.com>
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent 913317fe
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -1680,7 +1680,7 @@ static int reclaim_pte_range(pmd_t *pmd, unsigned long addr,
{
	struct reclaim_param *rp = walk->private;
	struct vm_area_struct *vma = rp->vma;
	pte_t *pte, ptent;
	pte_t *start_pte, *pte, ptent;
	spinlock_t *ptl;
	struct page *page;
	LIST_HEAD(page_list);
@@ -1692,8 +1692,8 @@ static int reclaim_pte_range(pmd_t *pmd, unsigned long addr,
		return 0;
cont:
	isolated = 0;
	pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
	for (; addr != end; pte++, addr += PAGE_SIZE) {
	start_pte = pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
	for (; addr < end; pte++, addr += PAGE_SIZE) {
		ptent = *pte;
		if (!pte_present(ptent))
			continue;
@@ -1702,6 +1702,15 @@ static int reclaim_pte_range(pmd_t *pmd, unsigned long addr,
		if (!page)
			continue;

		if (PageCompound(page)) {
			unsigned int order = compound_order(page);
			unsigned int nr_pages = (1 << order) - 1;

			addr += (nr_pages * PAGE_SIZE);
			pte += nr_pages;
			continue;
		}

		if (isolate_lru_page(page))
			continue;

@@ -1725,14 +1734,14 @@ static int reclaim_pte_range(pmd_t *pmd, unsigned long addr,
		if ((isolated >= SWAP_CLUSTER_MAX) || !rp->nr_to_reclaim)
			break;
	}
	pte_unmap_unlock(pte - 1, ptl);
	pte_unmap_unlock(start_pte, ptl);
	reclaimed = reclaim_pages_from_list(&page_list, vma);
	rp->nr_reclaimed += reclaimed;
	rp->nr_to_reclaim -= reclaimed;
	if (rp->nr_to_reclaim < 0)
		rp->nr_to_reclaim = 0;

	if (rp->nr_to_reclaim && (addr != end))
	if (rp->nr_to_reclaim && addr < end)
		goto cont;

	cond_resched();