[PATCH 2/2] mm: compaction: Minimise the time IRQs are disabled while isolating pages for migration

Date

Fri, 25 Feb 2011 20:04:59 +0000

From: Andrea Arcangeli <aarcange@redhat.com>

compaction_alloc() isolates pages for migration in isolate_migratepages. Whileit's scanning, IRQs are disabled on the mistaken assumption the scanningshould be short. Tests show this to be true for the most part butcontention times on the LRU lock can be increased. Before this patch,the IRQ disabled times for a simple test looked like

This patch reduces the worst-case IRQs-disabled latencies by releasing thelock every SWAP_CLUSTER_MAX pages that are scanned and releasing the CPU ifnecessary. The cost of this is that the processing performing compaction willbe slower but IRQs being disabled for too long a time has worse consequencesas the following report shows;