From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF7Nw-0002SU-JP for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:51:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF7Nv-0000O1-MN for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:51:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF7Nv-0000Nr-EP for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:51:27 -0400 Date: Fri, 21 Sep 2012 14:51:15 -0300 From: Rafael Aquini Message-ID: <20120921175115.GE6665@optiplex.redhat.com> References: <1348224383-1499-1-git-send-email-mgorman@suse.de> <1348224383-1499-6-git-send-email-mgorman@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1348224383-1499-6-git-send-email-mgorman@suse.de> Subject: Re: [Qemu-devel] [PATCH 5/9] mm: compaction: Acquire the zone->lru_lock as late as possible List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mel Gorman Cc: Richard Davies , KVM , QEMU-devel , LKML , Linux-MM , Avi Kivity , Andrew Morton , Shaohua Li On Fri, Sep 21, 2012 at 11:46:19AM +0100, Mel Gorman wrote: > Compactions migrate scanner acquires the zone->lru_lock when scanning a range > of pages looking for LRU pages to acquire. It does this even if there are > no LRU pages in the range. If multiple processes are compacting then this > can cause severe locking contention. To make matters worse commit b2eef8c0 > (mm: compaction: minimise the time IRQs are disabled while isolating pages > for migration) releases the lru_lock every SWAP_CLUSTER_MAX pages that are > scanned. > > This patch makes two changes to how the migrate scanner acquires the LRU > lock. First, it only releases the LRU lock every SWAP_CLUSTER_MAX pages if > the lock is contended. This reduces the number of times it unnecessarily > disables and re-enables IRQs. The second is that it defers acquiring the > LRU lock for as long as possible. If there are no LRU pages or the only > LRU pages are transhuge then the LRU lock will not be acquired at all > which reduces contention on zone->lru_lock. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini