lkml.org 
[lkml]   [2023]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] mm: compaction: optimize compact_memory to comply with the admin-guide
On Fri, 28 Apr 2023 11:58:48 +0100 Mel Gorman <mgorman@techsingularity.net> wrote:

> > --- a/mm/compaction.c
> > +++ b/mm/compaction.c
> > @@ -1736,6 +1736,7 @@ static int sysctl_compact_unevictable_allowed __read_mostly = CONFIG_COMPACT_UNE
> > */
> > static unsigned int __read_mostly sysctl_compaction_proactiveness = 20;
> > static int sysctl_extfrag_threshold = 500;
> > +static int sysctl_compact_memory;
> >
>
> __read_mostly but that aside, it's only used in
> sysctl_compaction_handler so could also be declared as static within
> that function. That way if CONFIG_SYSCTL is not set, it should be
> guaranteed that the compiler does not save storage for it.

but

static struct ctl_table vm_compaction[] = {
{
.procname = "compact_memory",
.data = &sysctl_compact_memory,
.maxlen = sizeof(int),
.mode = 0200,
.proc_handler = sysctl_compaction_handler,
},


I'll add the __read_mostly, thanks.

\
 
 \ /
  Last update: 2023-05-02 22:51    [W:0.049 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site