From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rafael Aquini Subject: Re: [PATCH 9/9] mm: compaction: Restart compaction from near where it left off Date: Fri, 21 Sep 2012 14:54:24 -0300 Message-ID: <20120921175424.GI6665@optiplex.redhat.com> References: <1348224383-1499-1-git-send-email-mgorman@suse.de> <1348224383-1499-10-git-send-email-mgorman@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Richard Davies , Shaohua Li , Rik van Riel , Avi Kivity , QEMU-devel , KVM , Linux-MM , LKML To: Mel Gorman Return-path: Content-Disposition: inline In-Reply-To: <1348224383-1499-10-git-send-email-mgorman@suse.de> Sender: owner-linux-mm@kvack.org List-Id: kvm.vger.kernel.org On Fri, Sep 21, 2012 at 11:46:23AM +0100, Mel Gorman wrote: > This is almost entirely based on Rik's previous patches and discussions > with him about how this might be implemented. > > Order > 0 compaction stops when enough free pages of the correct page > order have been coalesced. When doing subsequent higher order allocations, > it is possible for compaction to be invoked many times. > > However, the compaction code always starts out looking for things to compact > at the start of the zone, and for free pages to compact things to at the > end of the zone. > > This can cause quadratic behaviour, with isolate_freepages starting at > the end of the zone each time, even though previous invocations of the > compaction code already filled up all free memory on that end of the zone. > This can cause isolate_freepages to take enormous amounts of CPU with > certain workloads on larger memory systems. > > This patch caches where the migration and free scanner should start from on > subsequent compaction invocations using the pageblock-skip information. When > compaction starts it begins from the cached restart points and will > update the cached restart points until a page is isolated or a pageblock > is skipped that would have been scanned by synchronous compaction. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755135Ab2IURyk (ORCPT ); Fri, 21 Sep 2012 13:54:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54976 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751793Ab2IURyi (ORCPT ); Fri, 21 Sep 2012 13:54:38 -0400 Date: Fri, 21 Sep 2012 14:54:24 -0300 From: Rafael Aquini To: Mel Gorman Cc: Andrew Morton , Richard Davies , Shaohua Li , Rik van Riel , Avi Kivity , QEMU-devel , KVM , Linux-MM , LKML Subject: Re: [PATCH 9/9] mm: compaction: Restart compaction from near where it left off Message-ID: <20120921175424.GI6665@optiplex.redhat.com> References: <1348224383-1499-1-git-send-email-mgorman@suse.de> <1348224383-1499-10-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-10-git-send-email-mgorman@suse.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 21, 2012 at 11:46:23AM +0100, Mel Gorman wrote: > This is almost entirely based on Rik's previous patches and discussions > with him about how this might be implemented. > > Order > 0 compaction stops when enough free pages of the correct page > order have been coalesced. When doing subsequent higher order allocations, > it is possible for compaction to be invoked many times. > > However, the compaction code always starts out looking for things to compact > at the start of the zone, and for free pages to compact things to at the > end of the zone. > > This can cause quadratic behaviour, with isolate_freepages starting at > the end of the zone each time, even though previous invocations of the > compaction code already filled up all free memory on that end of the zone. > This can cause isolate_freepages to take enormous amounts of CPU with > certain workloads on larger memory systems. > > This patch caches where the migration and free scanner should start from on > subsequent compaction invocations using the pageblock-skip information. When > compaction starts it begins from the cached restart points and will > update the cached restart points until a page is isolated or a pageblock > is skipped that would have been scanned by synchronous compaction. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF7Qz-0003Kq-JQ for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:54:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF7Qy-00011L-KP for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:54:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF7Qy-00011B-C9 for qemu-devel@nongnu.org; Fri, 21 Sep 2012 13:54:36 -0400 Date: Fri, 21 Sep 2012 14:54:24 -0300 From: Rafael Aquini Message-ID: <20120921175424.GI6665@optiplex.redhat.com> References: <1348224383-1499-1-git-send-email-mgorman@suse.de> <1348224383-1499-10-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-10-git-send-email-mgorman@suse.de> Subject: Re: [Qemu-devel] [PATCH 9/9] mm: compaction: Restart compaction from near where it left off 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:23AM +0100, Mel Gorman wrote: > This is almost entirely based on Rik's previous patches and discussions > with him about how this might be implemented. > > Order > 0 compaction stops when enough free pages of the correct page > order have been coalesced. When doing subsequent higher order allocations, > it is possible for compaction to be invoked many times. > > However, the compaction code always starts out looking for things to compact > at the start of the zone, and for free pages to compact things to at the > end of the zone. > > This can cause quadratic behaviour, with isolate_freepages starting at > the end of the zone each time, even though previous invocations of the > compaction code already filled up all free memory on that end of the zone. > This can cause isolate_freepages to take enormous amounts of CPU with > certain workloads on larger memory systems. > > This patch caches where the migration and free scanner should start from on > subsequent compaction invocations using the pageblock-skip information. When > compaction starts it begins from the cached restart points and will > update the cached restart points until a page is isolated or a pageblock > is skipped that would have been scanned by synchronous compaction. > > Signed-off-by: Mel Gorman > Acked-by: Rik van Riel > --- Acked-by: Rafael Aquini