Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1104876pxb; Thu, 4 Mar 2021 03:29:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlexw3x/BOEzsQdlXrIpsglmccRRKsJsUSJknCd0WeNjvbUddAqMKstFKq1SDNvmKw9hhb X-Received: by 2002:a17:906:39a:: with SMTP id b26mr3797861eja.158.1614857357716; Thu, 04 Mar 2021 03:29:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614857357; cv=none; d=google.com; s=arc-20160816; b=ojwiUHUyDh1jHJg7WeESP7mrtdmrwiQzGwb2DOfssfF3vOXZJTQlN9wDa3QbKEFwWZ OCw59sYiDRlQpFKUkVQ7kN3ZUvFuMh8byqkSEDNVX/sJilrXrneOv6DfAN79En3DiIkF OWKmf6mk7E0LakuEdSELwt6b33WbyOnghrHhXLQVqOodrZv6SQ+BBYFrANv41q5YHus6 d7WFymwbb1NdV9uj4jFy/QeChS0xv4eYSDxq4pMtJDF7fij5dW3MWJxmDzLcqg4rAo9D AfN7qx/fkLNML4+nGnN5eQUGvYLIuYNdJCCgtzntwxOCoIKU8PlXT0Honhb4g0sP37RQ uTwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=apZmXTWwqH3OC7fNpu7dz9ehXMHteTrrn76iMve0R98=; b=EvQILgN7rGOVN/fN+qPk0GHZqrSv/k0lEy6UmHJrjD8JtDfG5pDRfooYnm6/+G4tpH xpFcgIhwDtn3fZ7HOZ7LAoGR23rSGqGY3xUEZEnt5+qURxqcIxf/mX5+Ejvdxs2qMupW qTubsVYyZpRpD8Ix3IovCCqoaXT3H1R/JkxyCdnFkNJTeH9W1gmeLAsWwc1MoSIZLhC9 DFOMi47d1Opu1X8OK7gADl56WCDlupj9QUf3jBaTC5+8py4qiX2Ay0RjkhyX9542sRTz +B5VVmfenkGw9/mUylJyY6ODxF32fp8OU7bcSCAHwp+eepw7eogkqWYsfhhtzq4pm62a wKJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=sEwneNUD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lc7si10281644ejb.426.2021.03.04.03.28.53; Thu, 04 Mar 2021 03:29:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=sEwneNUD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1577993AbhCCSBr (ORCPT + 99 others); Wed, 3 Mar 2021 13:01:47 -0500 Received: from m42-2.mailgun.net ([69.72.42.2]:25782 "EHLO m42-2.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447631AbhCCPEm (ORCPT ); Wed, 3 Mar 2021 10:04:42 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614783861; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=apZmXTWwqH3OC7fNpu7dz9ehXMHteTrrn76iMve0R98=; b=sEwneNUDOXZRfErvJS9Pykn7UFZDiAY9XoTNwkFjzn9vyp4FIX1CustxETA/rlBDnEHJ5gxh 5oY7pTsRp3ghuFYLVzFuN0/uYkGdOhZTaVu2cBY1KBDtv1s614qdqg+Y3x0cTeSaWxqwrxpK zo88uq3TsZm8du5eMu/983AYxPI= X-Mailgun-Sending-Ip: 69.72.42.2 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd 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-west-2.postgun.com with SMTP id 603f9e3fc862e1b9fd8f1e03 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 03 Mar 2021 14:33:35 GMT Sender: pintu=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 8FC21C433C6; Wed, 3 Mar 2021 14:33:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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