Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2928718ybh; Sat, 25 Jul 2020 06:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5iy7x3CjCDvy390giltTXR8pPYoQNlskRi4xCGkfJXZy1B+Mbd/F0VPyxcOvA9EKJLmx/ X-Received: by 2002:a50:9f46:: with SMTP id b64mr1326135edf.298.1595682159984; Sat, 25 Jul 2020 06:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595682159; cv=none; d=google.com; s=arc-20160816; b=e4SwakO00AYI9cO+Uy1HwUiAXZWjIQ7cn/uZsoRuvGj9J8FOctg3iaza7K2c4HnzS3 xAoHDbX0WE6+7fWU7WFkMxDWHxedjrxIorrN88jLchPvdHk9OOe1295CDt5xCGH7OQlk jIaruTVNcU6Ln9HPAEmLzBo+HylDa9o8UJ68o5Kaluah6xIhxZr5xpmM/YLEczcCUWv4 snQfMqmV+M/9DFvFMLNwMc2WG0wOUXrniMchtJ/pK3bjxSdV5KwpFExsGQxV98cZ/yFM PaPLZtJsHDrDDFCQaIrCM/wiZoTWNeFHVsmy5CIrfhHdSXVbIBl1ZJEon1gSfE3O3XXV 2gyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=jdvFCGFJw4d+/GkJOrSxjAc3YkcL/cQQla4c2tsYPN4=; b=nbjBAyR7WjrYUBJ7r4mTR9DCTICR1+VkjccgFpg3lKtf+taqv4G8mXt8t+Tl/ZGB2R DS7lVjm4dBBFzLF52airWWjoL7FUuBehUabWTpMM0jV/5i2gLPeXG7CLbaLLO9ufjlTz Xuf8QG5CQYIBs7pG1T1t/9fF10KX706Djv5ZG9jDkZ3tPEzeVs+rBguP+IfhYEhrA+M0 zReZkZPF2rewnNFV7DhUe/YTaDzAtWnjyfHGk7fN3dFENEFLbh3c2fIhqEi4iCA8JvBH b+DVED4oyB+msFjSx9B+lt1c3YasYtjGsm5p2QUBiBTIjkMBXp/Lw2O+3m9sN14Q/3Vh oaMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id re10si2362065ejb.156.2020.07.25.06.02.17; Sat, 25 Jul 2020 06:02:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727956AbgGYNBN (ORCPT + 99 others); Sat, 25 Jul 2020 09:01:13 -0400 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:48766 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727075AbgGYNAd (ORCPT ); Sat, 25 Jul 2020 09:00:33 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=23;SR=0;TI=SMTPD_---0U3l6fmD_1595682015; Received: from aliy8.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U3l6fmD_1595682015) by smtp.aliyun-inc.com(127.0.0.1); Sat, 25 Jul 2020 21:00:22 +0800 From: Alex Shi To: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, yang.shi@linux.alibaba.com, willy@infradead.org, hannes@cmpxchg.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com Cc: Steven Rostedt , Ingo Molnar , Vlastimil Babka , Mike Kravetz Subject: [PATCH v17 04/21] mm/compaction: rename compact_deferred as compact_should_defer Date: Sat, 25 Jul 2020 20:59:41 +0800 Message-Id: <1595681998-19193-5-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> References: <1595681998-19193-1-git-send-email-alex.shi@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The compact_deferred is a defer suggestion check, deferring action does in defer_compaction not here. so, better rename it to avoid confusing. Signed-off-by: Alex Shi Cc: Steven Rostedt Cc: Ingo Molnar Cc: Andrew Morton Cc: Vlastimil Babka Cc: Mike Kravetz Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org --- include/linux/compaction.h | 4 ++-- include/trace/events/compaction.h | 2 +- mm/compaction.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 6fa0eea3f530..be9ed7437a38 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h @@ -100,7 +100,7 @@ extern enum compact_result compaction_suitable(struct zone *zone, int order, unsigned int alloc_flags, int highest_zoneidx); extern void defer_compaction(struct zone *zone, int order); -extern bool compaction_deferred(struct zone *zone, int order); +extern bool compaction_should_defer(struct zone *zone, int order); extern void compaction_defer_reset(struct zone *zone, int order, bool alloc_success); extern bool compaction_restarting(struct zone *zone, int order); @@ -199,7 +199,7 @@ static inline void defer_compaction(struct zone *zone, int order) { } -static inline bool compaction_deferred(struct zone *zone, int order) +static inline bool compaction_should_defer(struct zone *zone, int order) { return true; } diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h index 54e5bf081171..33633c71df04 100644 --- a/include/trace/events/compaction.h +++ b/include/trace/events/compaction.h @@ -274,7 +274,7 @@ 1UL << __entry->defer_shift) ); -DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_deferred, +DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_should_defer, TP_PROTO(struct zone *zone, int order), diff --git a/mm/compaction.c b/mm/compaction.c index cd1ef9e5e638..f14780fc296a 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -154,7 +154,7 @@ void defer_compaction(struct zone *zone, int order) } /* Returns true if compaction should be skipped this time */ -bool compaction_deferred(struct zone *zone, int order) +bool compaction_should_defer(struct zone *zone, int order) { unsigned long defer_limit = 1UL << zone->compact_defer_shift; @@ -168,7 +168,7 @@ bool compaction_deferred(struct zone *zone, int order) if (zone->compact_considered >= defer_limit) return false; - trace_mm_compaction_deferred(zone, order); + trace_mm_compaction_should_defer(zone, order); return true; } @@ -2377,7 +2377,7 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order, enum compact_result status; if (prio > MIN_COMPACT_PRIORITY - && compaction_deferred(zone, order)) { + && compaction_should_defer(zone, order)) { rc = max_t(enum compact_result, COMPACT_DEFERRED, rc); continue; } @@ -2561,7 +2561,7 @@ static void kcompactd_do_work(pg_data_t *pgdat) if (!populated_zone(zone)) continue; - if (compaction_deferred(zone, cc.order)) + if (compaction_should_defer(zone, cc.order)) continue; if (compaction_suitable(zone, cc.order, 0, zoneid) != -- 1.8.3.1