Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758045Ab2KWIue (ORCPT ); Fri, 23 Nov 2012 03:50:34 -0500 Received: from mail-ie0-f174.google.com ([209.85.223.174]:33886 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754007Ab2KWIud (ORCPT ); Fri, 23 Nov 2012 03:50:33 -0500 Message-ID: <50AF38D2.6090106@gmail.com> Date: Fri, 23 Nov 2012 16:50:26 +0800 From: Jaegeuk Hanse User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Johannes Weiner CC: Rik van Riel , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: kswapd endless loop for compaction References: <20121120190440.GA24381@cmpxchg.org> In-Reply-To: <20121120190440.GA24381@cmpxchg.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2112 Lines: 57 On 11/21/2012 03:04 AM, Johannes Weiner wrote: > Hi guys, > > while testing a 3.7-rc5ish kernel, I noticed that kswapd can drop into > a busy spin state without doing reclaim. printk-style debugging told > me that this happens when the distance between a zone's high watermark > and its low watermark is less than two huge pages (DMA zone). > > 1. The first loop in balance_pgdat() over the zones finds all zones to > be above their high watermark and only does goto out (all_zones_ok). > > 2. pgdat_balanced() at the out: label also just checks the high > watermark, so the node is considered balanced and the order is not > reduced. > > 3. In the `if (order)' block after it, compaction_suitable() checks if > the zone's low watermark + twice the huge page size is okay, which > it's not necessarily in a small zone, and so COMPACT_SKIPPED makes it > it go back to loop_again:. > > This will go on until somebody else allocates and breaches the high > watermark and then hopefully goes on to reclaim the zone above low > watermark + 2 * THP. > > I'm not really sure what the correct solution is. Should we modify > the zone_watermark_ok() checks in balance_pgdat() to take into account > the higher watermark requirements for reclaim on behalf of compaction? > Change the check in compaction_suitable() / not use it directly? Hi Johannes, If depend on compaction get enough contigous pages, why if (CONPACT_BUILD && order && compaction_suitable(zone, order) != COMPACTION_SKIPPED) testorder = 0; can't guarantee low watermark + twice the huge page size is okay? Regards, Jaegeuk > Thanks, > Johannes > > -- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/