On 2021-03-03 22:39, Vlastimil Babka wrote:
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@xxxxxxxxxxxxxx>
Signed-off-by: Pintu Agarwal <pintu.ping@xxxxxxxxx>
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.
Oh yes, thank you so much for the reference.
Yes I was looking to do something similar but didn't realize that is
possible.
I will re-submit the new patch.
And yes, I will try to explore more on drop_caches part as well.
Thanks,
Pintu