All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Pintu Kumar <pintu@codeaurora.org>,
	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
Subject: Re: [PATCH] mm/compaction: remove unused variable sysctl_compact_memory
Date: Wed, 3 Mar 2021 18:09:18 +0100	[thread overview]
Message-ID: <486d7af3-95a3-9701-f0f9-706ff49b99d1@suse.cz> (raw)
In-Reply-To: <1614707773-10725-1-git-send-email-pintu@codeaurora.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 <pintu@codeaurora.org>
> Signed-off-by: Pintu Agarwal <pintu.ping@gmail.com>

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



  parent reply	other threads:[~2021-03-03 19:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 17:56 [PATCH] mm/compaction: remove unused variable sysctl_compact_memory Pintu Kumar
2021-03-02 20:18 ` Nitin Gupta
2021-03-03 14:33   ` pintu
2021-03-03 18:14     ` Nitin Gupta
2021-03-03  6:57 ` Chaitanya Kulkarni
2021-03-03 17:09 ` Vlastimil Babka [this message]
2021-03-03 17:47   ` pintu
2021-03-04 10:03     ` [PATCH v2] " Pintu Kumar
2021-03-04 10:57       ` Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=486d7af3-95a3-9701-f0f9-706ff49b99d1@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mateusznosek0@gmail.com \
    --cc=mcgrof@kernel.org \
    --cc=mgorman@techsingularity.net \
    --cc=nigupta@nvidia.com \
    --cc=pintu.ping@gmail.com \
    --cc=pintu@codeaurora.org \
    --cc=sh_def@163.com \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.