[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <486d7af3-95a3-9701-f0f9-706ff49b99d1@suse.cz>
Date: Wed, 3 Mar 2021 18:09:18 +0100
From: Vlastimil Babka <vbabka@...e.cz>
To: Pintu Kumar <pintu@...eaurora.org>, linux-kernel@...r.kernel.org,
akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-fsdevel@...r.kernel.org, iamjoonsoo.kim@....com,
sh_def@....com, mateusznosek0@...il.com, bhe@...hat.com,
nigupta@...dia.com, yzaikin@...gle.com, keescook@...omium.org,
mcgrof@...nel.org, mgorman@...hsingularity.net
Cc: pintu.ping@...il.com
Subject: Re: [PATCH] mm/compaction: remove unused variable
sysctl_compact_memory
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@...eaurora.org>
> Signed-off-by: Pintu Agarwal <pintu.ping@...il.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
Powered by blists - more mailing lists