From patchwork Thu Mar 4 10:03:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pintu Kumar X-Patchwork-Id: 12115803 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=-16.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,USER_AGENT_GIT 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 593F2C433E0 for ; Thu, 4 Mar 2021 10:04:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E7B6164F0A for ; Thu, 4 Mar 2021 10:04:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7B6164F0A 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 72E636B0008; Thu, 4 Mar 2021 05:04:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6DE376B000A; Thu, 4 Mar 2021 05:04:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 559976B000C; Thu, 4 Mar 2021 05:04:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 332826B0008 for ; Thu, 4 Mar 2021 05:04:06 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EC88118061B97 for ; Thu, 4 Mar 2021 10:04:05 +0000 (UTC) X-FDA: 77881756050.17.D270A74 Received: from z11.mailgun.us (z11.mailgun.us [104.130.96.11]) by imf20.hostedemail.com (Postfix) with ESMTP id 88F22132 for ; Thu, 4 Mar 2021 10:04:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614852245; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=kcRoAX9wKUGCY2tUhMsy4I/AJ378Sfygc6B2YBdp//M=; b=BlPl6hys6o4uu3+B6aIB1qTEwPDaNQxz0uXKtDqXykrhS6r4boGAKVWRirftKtOPFF5hnc+I GtAB1fuMBgHsg/B+JE8xEPq7zfr3mpIQQfrd8sAnINgEWPLeyxnRIJco/U9nlrhAU3BvGgVl iqD0fnpwiaY/mC6Ru/EB6C3CfuM= 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-n05.prod.us-east-1.postgun.com with SMTP id 6040b09181003345dc9a80a6 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 04 Mar 2021 10:04:01 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 1D534C43467; Thu, 4 Mar 2021 10:04:01 +0000 (UTC) Received: from blr-ubuntu-498.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pintu) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6324FC433CA; Thu, 4 Mar 2021 10:03:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6324FC433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=pintu@codeaurora.org From: Pintu Kumar 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, nigupta@nvidia.com, vbabka@suse.cz, yzaikin@google.com, keescook@chromium.org, mcgrof@kernel.org, mgorman@techsingularity.net Cc: pintu.ping@gmail.com Subject: [PATCH v2] mm/compaction: remove unused variable sysctl_compact_memory Date: Thu, 4 Mar 2021 15:33:44 +0530 Message-Id: <1614852224-14671-1-git-send-email-pintu@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 88F22132 X-Stat-Signature: pgboio364qou96486517nc5kz8xyq5sy Received-SPF: none (mg.codeaurora.org>: No applicable sender policy available) receiver=imf20; identity=mailfrom; envelope-from=""; helo=z11.mailgun.us; client-ip=104.130.96.11 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614852242-536702 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: 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