From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 F27C4C63798 for ; Tue, 24 Nov 2020 12:39:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4817B206B5 for ; Tue, 24 Nov 2020 12:39:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4817B206B5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 60DF66B00C7; Tue, 24 Nov 2020 07:39:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5BE4A6B00C8; Tue, 24 Nov 2020 07:39:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D4856B00C9; Tue, 24 Nov 2020 07:39:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 374876B00C7 for ; Tue, 24 Nov 2020 07:39:36 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 03DF18249980 for ; Tue, 24 Nov 2020 12:39:36 +0000 (UTC) X-FDA: 77519267952.12.shape66_2f04b002736e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id CACB11800BE93 for ; Tue, 24 Nov 2020 12:39:35 +0000 (UTC) X-HE-Tag: shape66_2f04b002736e X-Filterd-Recvd-Size: 4657 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Tue, 24 Nov 2020 12:39:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id AAE93AE6D; Tue, 24 Nov 2020 12:39:33 +0000 (UTC) Subject: Re: [PATCH] mm/compaction: make defer_compaction and compaction_deferred static To: Hui Su , akpm@linux-foundation.org, nigupta@nvidia.com, bhe@redhat.com, mateusznosek0@gmail.com, iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20201123170801.GA9625@rlk> From: Vlastimil Babka Message-ID: Date: Tue, 24 Nov 2020 13:39:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <20201123170801.GA9625@rlk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 11/23/20 6:08 PM, Hui Su wrote: > 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. > */ >