All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen, Hanxiao <chenhx.fnst@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] 答复:  [PATCH] memcg_use_hierarchy_test.sh: skip setting use_hierarchy if not available
Date: Wed, 14 Oct 2020 07:31:57 +0000	[thread overview]
Message-ID: <57e1161dae434ffda48b0e0cc261e706@G08CNEXMBPEKD04.g08.fujitsu.local> (raw)



Hi, Li

>???: Li Wang <liwang@redhat.com>
>????: 2020?10?14? 14:28
>???: Xu, Yang <xuyang2018.jy@cn.fujitsu.com>; Chen, Hanxiao <chenhx.fnst@cn.fujitsu.com>
>??: LTP List <ltp@lists.linux.it>
>??: Re: ??: [LTP] [PATCH] memcg_use_hierarchy_test.sh: skip setting use_hierarchy if not available
>
>
>
>On Tue, Oct 13, 2020 at 11:19 AM Yang Xu <xuyang2018.jy@cn.fujitsu.com> wrote:
>Hi Hanxiao
>
>> Hi, Yang
>>
>>> -----??????-----
>>> ???: Re: [LTP] [PATCH] memcg_use_hierarchy_test.sh: skip setting
>>> use_hierarchy if not available
[snip]
>> The behavior above looks conflicting with https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt.
>Yes. Centos7 behavior is different from the documentation.
>>> So why not directly use /dev/memcg/memory.use_hierarchy value to judge in
>>> testcase after setting 0.
>> In setup_test from memcg_lib.sh, we actually did:
>>     mount -t cgroup -omemory memcg /dev/memcg
>> Then kernel will find a suitable cgroup root for us in cgroup1_mount.
>>
>> In this case, /sys/fs/cgroup/memory/ would be the good choice.
>> So it's equivalent to read memory.use_hierarchy from either side.
>I understand. Only a minor suggestion, please use tabs instead of spaces
>at the beginning of the line.
>
>
>This patch looks good to me,
>Acked-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
>
>@Li, I think this patch is ok, Do you have some comment about it?
>
>I'm ok to go with memory.use_hierarchy checking in the preconditioning phase.
>
>But how can you assert the default memory cgroup is mount at path: "/sys/fs/cgroup/memory", is there any possibility the default path mount at other places(for different distribution)?

https://github.com/torvalds/linux/blob/b5fc7a89e58bcc059a3d5e4db79c481fb437de59/kernel/cgroup/cgroup.c#L5768

WARN_ON(sysfs_create_mount_point(fs_kobj, "cgroup"));

So the default mount place should be /sys/fs/cgroup if distributions
did not modify these lines.

As the discussion above,
mount -t cgroup -omemory memcg /dev/memcg
kernel will find a suitable cgroup root for us.

How about reading /dev/memcg/memory.use_hierarchy as Yang recommended instead?

Regards,

-   Hanxiao

>--
>Regards,
>Li Wang


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20201014/2c23546c/attachment-0001.htm>

             reply	other threads:[~2020-10-14  7:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  7:31 Chen, Hanxiao [this message]
2020-10-15  6:45 ` [LTP] [PATCH] memcg_use_hierarchy_test.sh: skip setting use_hierarchy if not available Li Wang
  -- strict thread matches above, loose matches on Subject: below --
2020-09-11  9:21 Chen Hanxiao
2020-09-17  5:21 ` Yang Xu
2020-09-21 10:53   ` [LTP] 答复: " Chen, Hanxiao
2020-10-13  3:19     ` Yang Xu
2020-10-14  6:27       ` Li Wang

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=57e1161dae434ffda48b0e0cc261e706@G08CNEXMBPEKD04.g08.fujitsu.local \
    --to=chenhx.fnst@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.