From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx183.postini.com [74.125.245.183]) by kanga.kvack.org (Postfix) with SMTP id 64D256B0031 for ; Tue, 23 Jul 2013 21:12:26 -0400 (EDT) Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 24 Jul 2013 06:34:27 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id DB319E0057 for ; Wed, 24 Jul 2013 06:42:19 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6O1DAUv39321710 for ; Wed, 24 Jul 2013 06:43:10 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6O1CHcp024324 for ; Wed, 24 Jul 2013 11:12:18 +1000 Date: Wed, 24 Jul 2013 09:12:16 +0800 From: Wanpeng Li Subject: Re: [PATCH v2 06/10] mm, hugetlb: remove redundant list_empty check in gather_surplus_pages() Message-ID: <20130724011216.GB22680@hacker.(null)> Reply-To: Wanpeng Li References: <1374482191-3500-1-git-send-email-iamjoonsoo.kim@lge.com> <1374482191-3500-7-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1374482191-3500-7-git-send-email-iamjoonsoo.kim@lge.com> Sender: owner-linux-mm@kvack.org List-ID: To: Joonsoo Kim Cc: Andrew Morton , Rik van Riel , Mel Gorman , Michal Hocko , "Aneesh Kumar K.V" , KAMEZAWA Hiroyuki , Hugh Dickins , Davidlohr Bueso , David Gibson , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim On Mon, Jul 22, 2013 at 05:36:27PM +0900, Joonsoo Kim wrote: >If list is empty, list_for_each_entry_safe() doesn't do anything. >So, this check is redundant. Remove it. > >Reviewed-by: Aneesh Kumar K.V >Signed-off-by: Joonsoo Kim > Reviewed-by: Wanpeng Li >diff --git a/mm/hugetlb.c b/mm/hugetlb.c >index 3ac0a6f..7ca8733 100644 >--- a/mm/hugetlb.c >+++ b/mm/hugetlb.c >@@ -1017,11 +1017,8 @@ free: > spin_unlock(&hugetlb_lock); > > /* Free unnecessary surplus pages to the buddy allocator */ >- if (!list_empty(&surplus_list)) { >- list_for_each_entry_safe(page, tmp, &surplus_list, lru) { >- put_page(page); >- } >- } >+ list_for_each_entry_safe(page, tmp, &surplus_list, lru) >+ put_page(page); > spin_lock(&hugetlb_lock); > > return ret; >-- >1.7.9.5 > >-- >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, 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