From patchwork Mon Nov 23 17:08:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Su X-Patchwork-Id: 11925763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E70D8C2D0E4 for ; Mon, 23 Nov 2020 17:08:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D60F2206E3 for ; Mon, 23 Nov 2020 17:08:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="n3Ti7z0b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D60F2206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E76976B00C0; Mon, 23 Nov 2020 12:08:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E27576B00C2; Mon, 23 Nov 2020 12:08:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEE2B6B00C3; Mon, 23 Nov 2020 12:08:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id A31146B00C0 for ; Mon, 23 Nov 2020 12:08:08 -0500 (EST) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 35A9533C4 for ; Mon, 23 Nov 2020 17:08:08 +0000 (UTC) X-FDA: 77516315856.09.dirt43_000555427367 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 185B7180AD80F for ; Mon, 23 Nov 2020 17:08:08 +0000 (UTC) X-HE-Tag: dirt43_000555427367 X-Filterd-Recvd-Size: 4868 Received: from m12-16.163.com (m12-16.163.com [220.181.12.16]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Nov 2020 17:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:Message-ID:MIME-Version; bh=lu+CC nmMmBQ4sYbPblnDdIkRR6VjoKrmcs5W1hkypLg=; b=n3Ti7z0bLalc+elkGblNv Pk+bYnyEUNwgk0Ld9arIrQEidv5VbktV8cZ17om2EDMKEl2tiTZr0U5jVBKly/SL eeATyIBe72DcyHrgtIcox3679RNhIpiy2YMYwzZJ3ORjN71/aKyQ7yqDG0emZfGp YT85SHhfqguaPNN+1kujgE= Received: from localhost (unknown [101.86.213.141]) by smtp12 (Coremail) with SMTP id EMCowAC3BUFx7Ltf73e_Ng--.5074S2; Tue, 24 Nov 2020 01:08:01 +0800 (CST) Date: Tue, 24 Nov 2020 01:08:01 +0800 From: Hui Su To: akpm@linux-foundation.org, nigupta@nvidia.com, vbabka@suse.cz, bhe@redhat.com, mateusznosek0@gmail.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: sh_def@163.com Subject: [PATCH] mm/compaction: make defer_compaction and compaction_deferred static Message-ID: <20201123170801.GA9625@rlk> MIME-Version: 1.0 Content-Disposition: inline X-CM-TRANSID: EMCowAC3BUFx7Ltf73e_Ng--.5074S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxGFyktF1rCw1Uuw4UWFW3KFg_yoW5ur1xpF 1Uu3W7A3s5XF15WrW8tF48Aa1Yvw4fKF18Ary0g348Jw1Yk3Z2y3WktFy5CF1UXryayr4j vF4UGw1kKrZxA3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07U2zuZUUUUU= X-Originating-IP: [101.86.213.141] X-CM-SenderInfo: xvkbvvri6rljoofrz/1tbiWRLlX1WBthD70wAAsr X-Bogosity: Ham, tests=bogofilter, spamicity=0.055106, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: defer_compaction() and compaction_deferred() and compaction_restarting() in mm/compaction.c won't be used in other files, so make them static, and remove the declaration in the header file. Take the chance to fix a typo. Signed-off-by: Hui Su Acked-by: Vlastimil Babka --- include/linux/compaction.h | 12 ------------ mm/compaction.c | 8 ++++---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/include/linux/compaction.h b/include/linux/compaction.h index 1de5a1151ee7..ed4070ed41ef 100644 --- a/include/linux/compaction.h +++ b/include/linux/compaction.h @@ -98,11 +98,8 @@ extern void reset_isolation_suitable(pg_data_t *pgdat); 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 void compaction_defer_reset(struct zone *zone, int order, bool alloc_success); -extern bool compaction_restarting(struct zone *zone, int order); /* Compaction has made some progress and retrying makes sense */ static inline bool compaction_made_progress(enum compact_result result) @@ -194,15 +191,6 @@ static inline enum compact_result compaction_suitable(struct zone *zone, int ord return COMPACT_SKIPPED; } -static inline void defer_compaction(struct zone *zone, int order) -{ -} - -static inline bool compaction_deferred(struct zone *zone, int order) -{ - return true; -} - static inline bool compaction_made_progress(enum compact_result result) { return false; diff --git a/mm/compaction.c b/mm/compaction.c index 13cb7a961b31..60135a820b55 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -157,7 +157,7 @@ EXPORT_SYMBOL(__ClearPageMovable); * allocation success. 1 << compact_defer_shift, compactions are skipped up * to a limit of 1 << COMPACT_MAX_DEFER_SHIFT */ -void defer_compaction(struct zone *zone, int order) +static void defer_compaction(struct zone *zone, int order) { zone->compact_considered = 0; zone->compact_defer_shift++; @@ -172,7 +172,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) +static bool compaction_deferred(struct zone *zone, int order) { unsigned long defer_limit = 1UL << zone->compact_defer_shift; @@ -209,7 +209,7 @@ void compaction_defer_reset(struct zone *zone, int order, } /* Returns true if restarting compaction after many failures */ -bool compaction_restarting(struct zone *zone, int order) +static bool compaction_restarting(struct zone *zone, int order) { if (order < zone->compact_order_failed) return false; @@ -237,7 +237,7 @@ static void reset_cached_positions(struct zone *zone) } /* - * Compound pages of >= pageblock_order should consistenly be skipped until + * Compound pages of >= pageblock_order should consistently be skipped until * released. It is always pointless to compact pages of such order (if they are * migratable), and the pageblocks they occupy cannot contain any free pages. */