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

Commit f44d2198 authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Linus Torvalds
Browse files

mm: do not reset cached_hole_size when vma is unmapped



In the current code, cached_hole_size is set to the maximum value if the
unmapped vma is less that free_area_cache so the next search will search
from the base address.

Actually, we can keep cached_hole_size so that if the next required size
is more than cached_hole_size, it can search from free_area_cache.

Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cbde83e2
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -1426,10 +1426,8 @@ void arch_unmap_area(struct mm_struct *mm, unsigned long addr)
	/*
	/*
	 * Is this a new hole at the lowest possible address?
	 * Is this a new hole at the lowest possible address?
	 */
	 */
	if (addr >= TASK_UNMAPPED_BASE && addr < mm->free_area_cache) {
	if (addr >= TASK_UNMAPPED_BASE && addr < mm->free_area_cache)
		mm->free_area_cache = addr;
		mm->free_area_cache = addr;
		mm->cached_hole_size = ~0UL;
	}
}
}


/*
/*