Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750994AbdFSORI (ORCPT ); Mon, 19 Jun 2017 10:17:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:32955 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750905AbdFSORH (ORCPT ); Mon, 19 Jun 2017 10:17:07 -0400 Subject: Re: [PATCH] mm: remove a redundant condition in the for loop To: Hao Lee , akpm@linux-foundation.org Cc: mgorman@techsingularity.net, mhocko@suse.com, hannes@cmpxchg.org, iamjoonsoo.kim@lge.com, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20170619135418.8580-1-haolee.swjtu@gmail.com> From: Vlastimil Babka Message-ID: Date: Mon, 19 Jun 2017 16:17:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170619135418.8580-1-haolee.swjtu@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1075 Lines: 31 On 06/19/2017 03:54 PM, Hao Lee wrote: > The variable current_order decreases from MAX_ORDER-1 to order, so the > condition current_order <= MAX_ORDER-1 is always true. > > Signed-off-by: Hao Lee Sounds right. Acked-by: Vlastimil Babka > --- > mm/page_alloc.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 2302f25..9120c2b 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -2215,9 +2215,8 @@ __rmqueue_fallback(struct zone *zone, unsigned int order, int start_migratetype) > bool can_steal; > > /* Find the largest possible block of pages in the other list */ > - for (current_order = MAX_ORDER-1; > - current_order >= order && current_order <= MAX_ORDER-1; > - --current_order) { > + for (current_order = MAX_ORDER-1; current_order >= order; > + --current_order) { > area = &(zone->free_area[current_order]); > fallback_mt = find_suitable_fallback(area, current_order, > start_migratetype, false, &can_steal); >