From patchwork Mon May 23 03:20:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Feng X-Patchwork-Id: 68323 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1002177qge; Sun, 22 May 2016 20:26:41 -0700 (PDT) X-Received: by 10.66.2.168 with SMTP id 8mr24139178pav.152.1463974001462; Sun, 22 May 2016 20:26:41 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xm8si48349161pab.11.2016.05.22.20.26.40; Sun, 22 May 2016 20:26:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752831AbcEWD01 (ORCPT + 30 others); Sun, 22 May 2016 23:26:27 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:10512 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752720AbcEWD00 (ORCPT ); Sun, 22 May 2016 23:26:26 -0400 Received: from 172.24.1.137 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.137]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DHM16101; Mon, 23 May 2016 11:20:31 +0800 (CST) Received: from vm163-62.huawei.com (10.184.163.62) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Mon, 23 May 2016 11:20:18 +0800 From: Chen Feng To: , , , , , , , CC: , , , , , Subject: [PATCH] mm: compact: remove watermark check at compact suitable Date: Mon, 23 May 2016 11:20:17 +0800 Message-ID: <1463973617-10599-1-git-send-email-puck.chen@hisilicon.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.184.163.62] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090203.5742777B.00A7, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 02a0138268edf89bafa1eecf1d8f7da4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are two paths calling this function. For direct compact, there is no need to check the zone watermark here. For kswapd wakeup kcompactd, since there is a reclaim before this. It makes sense to do compact even the watermark is ok at this time. Signed-off-by: Chen Feng --- mm/compaction.c | 7 ------- 1 file changed, 7 deletions(-) -- 1.9.1 diff --git a/mm/compaction.c b/mm/compaction.c index 8fa2540..cb322df 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -1260,13 +1260,6 @@ static unsigned long __compaction_suitable(struct zone *zone, int order, return COMPACT_CONTINUE; watermark = low_wmark_pages(zone); - /* - * If watermarks for high-order allocation are already met, there - * should be no need for compaction at all. - */ - if (zone_watermark_ok(zone, order, watermark, classzone_idx, - alloc_flags)) - return COMPACT_PARTIAL; /* * Watermarks for order-0 must be met for compaction. Note the 2UL.