mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kamalesh Babulal <kamalesh.babulal@oracle.com>
To: Luiz Capitulino <luizcap@amazon.com>,
	tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
	longman@redhat.com
Cc: lcapitulino@gmail.com
Subject: Re: [PATH v2] cgroup: add cgroup_favordynmods= command-line option
Date: Wed, 6 Sep 2023 12:28:54 +0530	[thread overview]
Message-ID: <5487ed0a-8483-0a92-c7c1-9ca3ed8e6162@oracle.com> (raw)
In-Reply-To: <20230906005712.66461-1-luizcap@amazon.com>


On 9/6/23 06:27, Luiz Capitulino wrote:
[...]
> diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
> index 1fb7f562289d..2b7d74304606 100644
> --- a/kernel/cgroup/cgroup.c
> +++ b/kernel/cgroup/cgroup.c
> @@ -207,6 +207,8 @@ static u16 have_exit_callback __read_mostly;
>  static u16 have_release_callback __read_mostly;
>  static u16 have_canfork_callback __read_mostly;
>  
> +static bool have_favordynmods __ro_after_init = IS_ENABLED(CONFIG_CGROUP_FAVOR_DYNMODS);
> +
>  /* cgroup namespace for init task */
>  struct cgroup_namespace init_cgroup_ns = {
>  	.ns.count	= REFCOUNT_INIT(2),
> @@ -2243,9 +2245,9 @@ static int cgroup_init_fs_context(struct fs_context *fc)
>  	fc->user_ns = get_user_ns(ctx->ns->user_ns);
>  	fc->global = true;
>  
> -#ifdef CONFIG_CGROUP_FAVOR_DYNMODS
> -	ctx->flags |= CGRP_ROOT_FAVOR_DYNMODS;
> -#endif
> +	if (have_favordynmods)
> +		ctx->flags |= CGRP_ROOT_FAVOR_DYNMODS;
> +
>  	return 0;
>  }
>  
> @@ -6764,6 +6766,12 @@ static int __init enable_cgroup_debug(char *str)
>  }
>  __setup("cgroup_debug", enable_cgroup_debug);
>  
> +static int __init cgroup_favordynmods_setup(char *str)
> +{
> +	return (kstrtobool(str, &have_favordynmods) == 0);
> +}
> +__setup("cgroup_favordynmods=", cgroup_favordynmods_setup);
> +
>  /**
>   * css_tryget_online_from_dir - get corresponding css from a cgroup dentry
>   * @dentry: directory dentry of interest

Consider a case where the kernel is compiled with
CONFIG_CGROUP_FAVOR_DYNMODS=n and kernel command line is passed with
cgroup_favordynmods=true, this would set the have_favordynmods to true.
In cgroup_favordynmods_setup(), should it return 0 with a pr_warn(),
when CONFIG_CGROUP_FAVOR_DYNMODS=n in the above case, or is this
expected behavior?

-- 
Thanks,
Kamalesh

  parent reply	other threads:[~2023-09-06  7:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06  0:57 Luiz Capitulino
2023-09-06  1:53 ` Waiman Long
2023-09-06  6:58 ` Kamalesh Babulal [this message]
2023-09-06 12:59   ` Waiman Long
2023-09-07  9:51     ` [External] : " Kamalesh Babulal
2023-09-07 18:47       ` Luiz Capitulino
2023-09-08  7:04         ` Kamalesh Babulal
2023-09-07 15:06 ` Michal Koutný
2023-09-07 15:16   ` Luiz Capitulino
2023-09-07 15:57     ` Michal Koutný
2023-09-07 18:57       ` Luiz Capitulino
     [not found] ` <29bdb453-c6e3-a047-1f27-e9656da92301@amazon.com>
2023-09-18 17:47   ` Tejun Heo
2023-09-19 11:00     ` Michal Koutný
2023-09-19 13:42       ` Luiz Capitulino

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=5487ed0a-8483-0a92-c7c1-9ca3ed8e6162@oracle.com \
    --to=kamalesh.babulal@oracle.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=lcapitulino@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=longman@redhat.com \
    --cc=luizcap@amazon.com \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®