Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1130794pxb; Thu, 4 Mar 2021 04:14:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJw76CS5O+CwfgOSbeWbEasx/xFBFM1mBTWHNSLyg78xzskMHvBYNM0OHWgBayNrtyW152K2 X-Received: by 2002:a05:6402:268f:: with SMTP id w15mr3927125edd.333.1614860073251; Thu, 04 Mar 2021 04:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614860073; cv=none; d=google.com; s=arc-20160816; b=Ly0zHcdj17X+arC2NWzPN3pNDPJbYTmtZsWaDCbo4by5WLL5ZMwoEXKeca0m/PmZtd qDWJTdHabXGyPtt9QkyeK1AYKdaSJ5o5lDlITHGJF67yaoMtXJHcoPScmXYrMsq7W3wm mdTLk3K8WGLXwi6Yqm8vKOuVbTVG5WIV1E8wgnrAvR4fmLYApT9eD5XWunUBtC/YcXWJ 4ajKnZkBU1uognu5jt7IOZ5LcLYrv2Ll6+L3sBcNv8tzjXuQV1LNakKvCRewqF/FPiTK EomjbZ6jVzxtOYDg9ujeDds2EGHdTV2lgaAfcvIk6Kqh5cwp0HLnxs6evwureqjmrB8c 3uYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Ayn6KaHY+LQbwJCjIYxXnA9QZLaNIwqIMRwjHZVYK2s=; b=u7WnzkSaeDFtxGpPwu9ePdKBLD25eFNWPkTG5vYtwZTC7jhhtJZhV18m2oVh2Jq1/z ivmjieB7dQ06r5B1iD8ZwSzd2klgmF0AuSLASSo66Q1pKwXroOwCBOsLBHDcxRd3uw8k gLEK79at4gBtgunlvxFfNKE22754OMDyoJoc8iMtBqNVjnCeqAuhJzc7oj35HH2kjqqs R8faAkz2oXZk/y1K3LgCc9birf8cQEOE3il/6y9CCTW+Z9QYrG051CBbOR3raFILqekd fCKhbBMEe1CJ9Ng4KJZNjygohvo7Cff7CJ79x/NPav1/YEZ+RQ+hvFnSGaWy5nR4r7lM WnlA== ARC-Authentication-Results: i=1; mx.google.com; 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 bq17si11171722ejb.621.2021.03.04.04.14.10; Thu, 04 Mar 2021 04:14:33 -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; 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 S1580259AbhCCSdg (ORCPT + 99 others); Wed, 3 Mar 2021 13:33:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:39946 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385364AbhCCRKG (ORCPT ); Wed, 3 Mar 2021 12:10:06 -0500 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 39590AC24; Wed, 3 Mar 2021 17:09:22 +0000 (UTC) Subject: Re: [PATCH] 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: <1614707773-10725-1-git-send-email-pintu@codeaurora.org> From: Vlastimil Babka Message-ID: <486d7af3-95a3-9701-f0f9-706ff49b99d1@suse.cz> Date: Wed, 3 Mar 2021 18:09:18 +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: <1614707773-10725-1-git-send-email-pintu@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/2/21 6:56 PM, Pintu Kumar wrote: > 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. > No functionality is broken or changed this way. > > Signed-off-by: Pintu Kumar > Signed-off-by: Pintu Agarwal You should be able to remove the variable completely and set .data to NULL in the corresponding entry. The sysctl_compaction_handler doesn't access it at all. Then you could do the same with drop_caches. Currently drop_caches_sysctl_handler currently writes to it, but that can be avoided using a local variable - see how sysrq_sysctl_handler avoids the global variable and its corresponding .data field is NULL. Vlastimil