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=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 DCF89C433DB for ; Wed, 3 Mar 2021 14:33:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6614364E87 for ; Wed, 3 Mar 2021 14:33:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6614364E87 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BF2818D016F; Wed, 3 Mar 2021 09:33:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA2D58D0157; Wed, 3 Mar 2021 09:33:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A43B58D016F; Wed, 3 Mar 2021 09:33:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0196.hostedemail.com [216.40.44.196]) by kanga.kvack.org (Postfix) with ESMTP id 8A05E8D0157 for ; Wed, 3 Mar 2021 09:33:46 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3CEA7180FDD97 for ; Wed, 3 Mar 2021 14:33:46 +0000 (UTC) X-FDA: 77878806852.03.2C334D7 Received: from z11.mailgun.us (z11.mailgun.us [104.130.96.11]) by imf01.hostedemail.com (Postfix) with ESMTP id AB2A020053EF for ; Wed, 3 Mar 2021 14:33:40 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614782021; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=apZmXTWwqH3OC7fNpu7dz9ehXMHteTrrn76iMve0R98=; b=vsgwsn4gcuSNT5WzEV/Ou+P29tjPYItjph3sa3TZIDRfDlcDy5u+RMsSCgE57J3+XCMpw8/J QDYXKm5YMHx1Abo99p+7iJseViQ6GFiweWy6IwzD2+tX5sQmXZJ5tZgrzl/a3A9X6BNypm84 tVFGd4H3+5fL61nE1GRauY6j/jY= X-Mailgun-Sending-Ip: 104.130.96.11 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-west-2.postgun.com with SMTP id 603f9e3f2a5e6d1bfa2e7858 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 03 Mar 2021 14:33:35 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 69B4DC43462; Wed, 3 Mar 2021 14:33:35 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: pintu) by smtp.codeaurora.org (Postfix) with ESMTPSA id 37FD3C433ED; Wed, 3 Mar 2021 14:33:33 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 03 Mar 2021 20:03:33 +0530 From: pintu@codeaurora.org To: Nitin Gupta Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, iamjoonsoo.kim@lge.com, sh_def@163.com, mateusznosek0@gmail.com, bhe@redhat.com, vbabka@suse.cz, yzaikin@google.com, keescook@chromium.org, mcgrof@kernel.org, mgorman@techsingularity.net, pintu.ping@gmail.com Subject: Re: [PATCH] mm/compaction: remove unused variable sysctl_compact_memory In-Reply-To: References: <1614707773-10725-1-git-send-email-pintu@codeaurora.org> Message-ID: X-Sender: pintu@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: AB2A020053EF X-Stat-Signature: 1ser77s619x3d4o5de3bmp5pxbk6kqwn Received-SPF: none (mg.codeaurora.org>: No applicable sender policy available) receiver=imf01; identity=mailfrom; envelope-from=""; helo=z11.mailgun.us; client-ip=104.130.96.11 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614782020-899880 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 2021-03-03 01:48, Nitin Gupta wrote: >> -----Original Message----- >> From: pintu=codeaurora.org@mg.codeaurora.org >> On Behalf Of Pintu Kumar >> Sent: Tuesday, March 2, 2021 9:56 AM >> To: linux-kernel@vger.kernel.org; akpm@linux-foundation.org; linux- >> mm@kvack.org; linux-fsdevel@vger.kernel.org; pintu@codeaurora.org; >> iamjoonsoo.kim@lge.com; sh_def@163.com; mateusznosek0@gmail.com; >> bhe@redhat.com; Nitin Gupta ; vbabka@suse.cz; >> yzaikin@google.com; keescook@chromium.org; mcgrof@kernel.org; >> mgorman@techsingularity.net >> Cc: pintu.ping@gmail.com >> Subject: [PATCH] mm/compaction: remove unused variable >> sysctl_compact_memory >> >> External email: Use caution opening links or attachments >> >> >> The sysctl_compact_memory is mostly unsed in mm/compaction.c It just >> acts >> as a place holder for sysctl. >> >> Thus we can remove it from here and move the declaration directly in >> kernel/sysctl.c itself. >> This will also eliminate the extern declaration from header file. > > > I prefer keeping the existing pattern of listing all compaction related > tunables > together in compaction.h: > > extern int sysctl_compact_memory; > extern unsigned int sysctl_compaction_proactiveness; > extern int sysctl_extfrag_threshold; > extern int sysctl_compact_unevictable_allowed; > Thanks Nitin for your review. You mean, you just wanted to retain this extern declaration ? Any real benefit of keeping this declaration if not used elsewhere ? > >> No functionality is broken or changed this way. >> >> Signed-off-by: Pintu Kumar >> Signed-off-by: Pintu Agarwal >> --- >> include/linux/compaction.h | 1 - >> kernel/sysctl.c | 1 + >> mm/compaction.c | 3 --- >> 3 files changed, 1 insertion(+), 4 deletions(-) >> >> diff --git a/include/linux/compaction.h b/include/linux/compaction.h >> index >> ed4070e..4221888 100644 >> --- a/include/linux/compaction.h >> +++ b/include/linux/compaction.h >> @@ -81,7 +81,6 @@ static inline unsigned long compact_gap(unsigned int >> order) } >> >> #ifdef CONFIG_COMPACTION >> -extern int sysctl_compact_memory; >> extern unsigned int sysctl_compaction_proactiveness; extern int >> sysctl_compaction_handler(struct ctl_table *table, int write, >> void *buffer, size_t *length, loff_t *ppos); >> diff --git >> a/kernel/sysctl.c b/kernel/sysctl.c index c9fbdd8..66aff21 100644 >> --- a/kernel/sysctl.c >> +++ b/kernel/sysctl.c >> @@ -198,6 +198,7 @@ static int max_sched_tunable_scaling = >> SCHED_TUNABLESCALING_END-1; #ifdef CONFIG_COMPACTION static int >> min_extfrag_threshold; static int max_extfrag_threshold = 1000; >> +static int sysctl_compact_memory; >> #endif >> >> #endif /* CONFIG_SYSCTL */ >> diff --git a/mm/compaction.c b/mm/compaction.c index 190ccda..ede2886 >> 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -2650,9 +2650,6 @@ static void compact_nodes(void) >> compact_node(nid); >> } >> >> -/* The written value is actually unused, all memory is compacted */ >> -int >> sysctl_compact_memory; >> - > > > Please retain this comment for the tunable. Sorry, I could not understand. You mean to say just retain this last comment and only remove the variable ? Again any real benefit you see in retaining this even if its not used? Thanks, Pintu