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=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 441C7C433DB for ; Thu, 4 Mar 2021 10:57:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B3F6464E67 for ; Thu, 4 Mar 2021 10:57:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3F6464E67 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 3BDFB6B0005; Thu, 4 Mar 2021 05:57:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 36CFA6B0006; Thu, 4 Mar 2021 05:57:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 234986B0007; Thu, 4 Mar 2021 05:57:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id 0A3DE6B0005 for ; Thu, 4 Mar 2021 05:57:39 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id BADAC181BA3E0 for ; Thu, 4 Mar 2021 10:57:38 +0000 (UTC) X-FDA: 77881890996.11.CF568E4 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf27.hostedemail.com (Postfix) with ESMTP id 0109C80192D5 for ; Thu, 4 Mar 2021 10:57:36 +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 C4E35AD21; Thu, 4 Mar 2021 10:57:36 +0000 (UTC) Subject: Re: [PATCH v2] mm/compaction: remove unused variable sysctl_compact_memory To: Pintu Kumar , 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, nigupta@nvidia.com, yzaikin@google.com, keescook@chromium.org, mcgrof@kernel.org, mgorman@techsingularity.net Cc: pintu.ping@gmail.com References: <1614852224-14671-1-git-send-email-pintu@codeaurora.org> From: Vlastimil Babka Message-ID: <9df94aca-7121-5d7a-8f92-890d8d5e8223@suse.cz> Date: Thu, 4 Mar 2021 11:57:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <1614852224-14671-1-git-send-email-pintu@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Stat-Signature: 6w9o7q1k7k7fg3jzeigczeitgb3mwrpy X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0109C80192D5 Received-SPF: none (suse.cz>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=mx2.suse.de; client-ip=195.135.220.15 X-HE-DKIM-Result: none/none X-HE-Tag: 1614855456-628509 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 3/4/21 11:03 AM, Pintu Kumar wrote: > The sysctl_compact_memory is mostly unused in mm/compaction.c > It just acts as a place holder for sysctl to store .data. > > But the .data itself is not needed here. > So we can get ride of this variable completely and make .data as NULL. > This will also eliminate the extern declaration from header file. > No functionality is broken or changed this way. > > Signed-off-by: Pintu Kumar > Signed-off-by: Pintu Agarwal Reviewed-by: Vlastimil Babka > --- > v2: completely get rid of this variable and set .data to NULL > Suggested-by: Vlastimil Babka > > include/linux/compaction.h | 1 - > kernel/sysctl.c | 2 +- > mm/compaction.c | 3 --- > 3 files changed, 1 insertion(+), 5 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..07ef240 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -2856,7 +2856,7 @@ static struct ctl_table vm_table[] = { > #ifdef CONFIG_COMPACTION > { > .procname = "compact_memory", > - .data = &sysctl_compact_memory, > + .data = NULL, > .maxlen = sizeof(int), > .mode = 0200, > .proc_handler = sysctl_compaction_handler, > 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; > - > /* > * Tunable for proactive compaction. It determines how > * aggressively the kernel should compact memory in the >