From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751525Ab2LTU6K (ORCPT ); Thu, 20 Dec 2012 15:58:10 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52766 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750869Ab2LTU6D (ORCPT ); Thu, 20 Dec 2012 15:58:03 -0500 Date: Thu, 20 Dec 2012 12:58:02 -0800 From: Andrew Morton To: Mel Gorman Cc: Zlatko Calusic , Linus Torvalds , Hugh Dickins , linux-mm , Linux Kernel Mailing List Subject: Re: [PATCH] mm: do not sleep in balance_pgdat if there's no i/o congestion Message-Id: <20121220125802.23e9b22d.akpm@linux-foundation.org> In-Reply-To: <20121220111208.GD10819@suse.de> References: <50D24AF3.1050809@iskon.hr> <20121220111208.GD10819@suse.de> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Dec 2012 11:12:08 +0000 Mel Gorman wrote: > On Thu, Dec 20, 2012 at 12:17:07AM +0100, Zlatko Calusic wrote: > > On a 4GB RAM machine, where Normal zone is much smaller than > > DMA32 zone, the Normal zone gets fragmented in time. This requires > > relatively more pressure in balance_pgdat to get the zone above the > > required watermark. Unfortunately, the congestion_wait() call in there > > slows it down for a completely wrong reason, expecting that there's > > a lot of writeback/swapout, even when there's none (much more common). > > After a few days, when fragmentation progresses, this flawed logic > > translates to a very high CPU iowait times, even though there's no > > I/O congestion at all. If THP is enabled, the problem occurs sooner, > > but I was able to see it even on !THP kernels, just by giving it a bit > > more time to occur. > > > > The proper way to deal with this is to not wait, unless there's > > congestion. Thanks to Mel Gorman, we already have the function that > > perfectly fits the job. The patch was tested on a machine which > > nicely revealed the problem after only 1 day of uptime, and it's been > > working great. > > --- > > mm/vmscan.c | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > Acked-by: Mel Gorman