linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: ye.xingchen@zte.com.cn, mcgrof@kernel.org
Cc: keescook@chromium.org, yzaikin@google.com,
	akpm@linux-foundation.org, linmiaohe@huawei.com,
	chi.minghao@zte.com.cn, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH V2 1/2] sysctl: Limit the value of interface compact_memory
Date: Wed, 8 Mar 2023 11:21:36 +0100	[thread overview]
Message-ID: <83344b3d-1de1-f3c2-913c-a8c54ce7a99f@suse.cz> (raw)
In-Reply-To: <202303061407332798543@zte.com.cn>



On 3/6/23 07:07, ye.xingchen@zte.com.cn wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> In Documentation/admin-guide/sysctl/vm.rst:109 say: when 1 is written
> to the file, all zones are compacted such that free memory is available
> in contiguous blocks where possible.
> So limit the value of interface compact_memory to 1.
> 
> Link: https://lore.kernel.org/all/ZAJwoXJCzfk1WIBx@bombadil.infradead.org/

I don't think the split to two patches you did, achieves Luis' request.

> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
> 
> ---
>  include/linux/compaction.h | 1 +
>  kernel/sysctl.c            | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/compaction.h b/include/linux/compaction.h
> index 52a9ff65faee..caa24e33eeb1 100644
> --- a/include/linux/compaction.h
> +++ b/include/linux/compaction.h
> @@ -81,6 +81,7 @@ static inline unsigned long compact_gap(unsigned int order)
>  }
> 
>  #ifdef CONFIG_COMPACTION
> +extern int sysctl_compact_memory;
>  extern unsigned int sysctl_compaction_proactiveness;
>  extern int sysctl_compaction_handler(struct ctl_table *table, int write,
>  			void *buffer, size_t *length, loff_t *ppos);
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index c14552a662ae..67f70952f71a 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -2192,10 +2192,12 @@ static struct ctl_table vm_table[] = {
>  #ifdef CONFIG_COMPACTION
>  	{
>  		.procname	= "compact_memory",
> -		.data		= NULL,
> +		.data		= &sysctl_compact_memory,

I doubt this compiles/links without patch 2, as there's no definition
until patch 2.

>  		.maxlen		= sizeof(int),
>  		.mode		= 0200,
>  		.proc_handler	= sysctl_compaction_handler,
> +		.extra1		= SYSCTL_ONE,
> +		.extra2		= SYSCTL_ONE,
>  	},
>  	{
>  		.procname	= "compaction_proactiveness",

IIUC his request was to move the compaction entries out of sysctl.c?



  reply	other threads:[~2023-03-08 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  6:07 ye.xingchen
2023-03-08 10:21 ` Vlastimil Babka [this message]
2023-03-08 19:58   ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83344b3d-1de1-f3c2-913c-a8c54ce7a99f@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=chi.minghao@zte.com.cn \
    --cc=keescook@chromium.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=ye.xingchen@zte.com.cn \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox