From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail144.messagelabs.com (mail144.messagelabs.com [216.82.254.51]) by kanga.kvack.org (Postfix) with SMTP id B3E2C6B0022 for ; Mon, 30 May 2011 08:53:49 -0400 (EDT) Date: Mon, 30 May 2011 13:53:45 +0100 From: Mel Gorman Subject: Re: [PATCH] mm: fix special case -1 order check in compact_finished Message-ID: <20110530125345.GB5118@suse.de> References: <20110530123831.GG20166@tiehlicka.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20110530123831.GG20166@tiehlicka.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, LKML On Mon, May 30, 2011 at 02:38:31PM +0200, Michal Hocko wrote: > 56de7263 (mm: compaction: direct compact when a high-order allocation > fails) introduced a check for cc->order == -1 in compact_finished. We > should continue compacting in that case because the request came from > userspace and there is no particular order to compact for. > > The check is, however, done after zone_watermark_ok which uses order as > a right hand argument for shifts. Not only watermark check is pointless > if we can break out without it but it also uses 1 << -1 which is not > well defined (at least from C standard). Let's move the -1 check above > zone_watermark_ok. > > Signed-off-by: Michal Hocko > Cc: Mel Gorman Acked-by: Mel Gorman -- Mel Gorman SUSE Labs -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org