From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757281AbbIUQSM (ORCPT ); Mon, 21 Sep 2015 12:18:12 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:37645 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756659AbbIUQSJ (ORCPT ); Mon, 21 Sep 2015 12:18:09 -0400 Date: Mon, 21 Sep 2015 18:18:07 +0200 From: Michal Hocko To: Yaowei Bai Cc: akpm@linux-foundation.org, mgorman@suse.de, rientjes@google.com, hannes@cmpxchg.org, vdavydov@parallels.com, oleg@redhat.com, vbabka@suse.cz, iamjoonsoo.kim@lge.com, zhangyanfei@cn.fujitsu.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] mm/vmscan: make inactive_anon_is_low_global return directly Message-ID: <20150921161806.GE19811@dhcp22.suse.cz> References: <1442404800-4051-1-git-send-email-bywxiaobai@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442404800-4051-1-git-send-email-bywxiaobai@163.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 16-09-15 19:59:58, Yaowei Bai wrote: > Delete unnecessary if to let inactive_anon_is_low_global return > directly. > > No functional changes. Is this really an improvement? I am not so sure. If anything the function has a bool return semantic... > Signed-off-by: Yaowei Bai > --- > mm/vmscan.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/mm/vmscan.c b/mm/vmscan.c > index 2d978b2..2785d8e 100644 > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1866,10 +1866,7 @@ static int inactive_anon_is_low_global(struct zone *zone) > active = zone_page_state(zone, NR_ACTIVE_ANON); > inactive = zone_page_state(zone, NR_INACTIVE_ANON); > > - if (inactive * zone->inactive_ratio < active) > - return 1; > - > - return 0; > + return inactive * zone->inactive_ratio < active; > } > > /** > -- > 1.9.1 > > > -- > 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 -- Michal Hocko SUSE Labs