lkml.org 
[lkml]   [2021]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm/compaction: remove unused variable sysctl_compact_memory
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@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.
>

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

\
 
 \ /
  Last update: 2021-03-03 20:40    [W:0.127 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site