Messages in this thread | | | Date | Tue, 2 May 2023 13:50:08 -0700 | From | Andrew Morton <> | Subject | Re: [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.
| |