public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Richard Palethorpe <rpalethorpe@suse.de>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: LTP List <ltp@lists.linux.it>,
	Luke Nowakowski-Krijger <luke.nowakowskikrijger@canonical.com>
Subject: Re: [LTP] [PATCH 1/4] controllers/memcg: update stress test to work under cgroup2
Date: Mon, 13 Dec 2021 08:50:25 +0000	[thread overview]
Message-ID: <87pmq0ajnw.fsf@suse.de> (raw)
In-Reply-To: <YbMurQKsabIfCOMu@yuki>

Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Hi!
>> Yes, we would have to remember what we mounted. I think the part I am most
>> curious about is how we would generate that state i.e what we mounted,
>> because the Cgroup library does not expose any of this as far as I'm aware.
>> 
>> If we want to use the tst_cgroup C lib to cleanup as well we would have to
>> find a way to reintroduce test state to the lib that we are losing between
>> calls of the utility, which the only way I could think of is introducing a
>> way to export and import test state within the lib. e.g.
>> tst_cgroup_print_test_state() tst_cgroup_load_test_state(), which doesn't
>> feel good as it exposes some of the nice API you have going on. This
>> is the

struct tst_cgroup_opts and tst_cgroup_print_config could be
extended. These are presently only used for debugging IIRC.

BTW don't worry about the purity of API too much or how it's implemented
to begin with. The current API is nice, but that is only after a lengthy
review process.

>> easiest way to tell if we are mounting things because we can just print
>> what we mounted, what the test dir of the test is, and reload that state.
>> This could have further applications to not just this scenario but also to
>> scenarios where if a test dies its state can be reloaded, etc, almost in a
>> checkpoint way. Not saying its common but adds some flexibility to the API
>> and I could see it having applications outside of this utility.

Perhaps, but if a test dies then we usually assume a kernel bug happened
and abort. In the future we want tests to be able to restart the system,
but we don't have concrete information about such scenarios.

>> 
>> Alternatively we could inspect what we created and generate state that way,
>> i.e. make a call to tst_cgroup_require() and see if new things were
>> mounted. Then we would have to manually be freeing things. I don't like
>> this approach because it goes against the whole point of this which was
>> code reuse. But the cleanup of things isnt the most difficult part so it
>> wouldn't be the biggest deal to redo the logic.

We have to save the PID (or some kind of test ID) that is used to
identify the CGroup. So may as well save what CGroups we created as
well.

>> 
>> Yes, sounds good.
>> >
>> >
>> Let me know what you think. I wouldn't want to add anything huge to the API
>> without your blessing :)
>
> Wouldn't it be easier to rewrite these test to the C then? I think that
> error handling in shell CGroup tests would always be more difficuilt
> than in C and given that we have a nice library for C it actually sounds
> like a better solution.

Yeah, I would prefer C in general. I'm not sure what is the path of
least resistance though.

-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2021-12-13 10:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27  0:04 [LTP] [PATCH 0/4] Update cgroup_fj and memcg controller tests to work under cgroup2 Luke Nowakowski-Krijger
2021-11-27  0:04 ` [LTP] [PATCH 1/4] controllers/memcg: update stress test " Luke Nowakowski-Krijger
2021-12-01  9:13   ` Li Wang
2021-12-01 22:17     ` Luke Nowakowski-Krijger
2021-12-02  7:46       ` Li Wang
2021-12-02  9:23         ` Richard Palethorpe
2021-12-02 19:28           ` Luke Nowakowski-Krijger
2021-12-03 10:25             ` Li Wang
2021-12-03 20:44               ` Luke Nowakowski-Krijger
2021-12-06  8:31                 ` Richard Palethorpe
2021-12-09 21:42                   ` Luke Nowakowski-Krijger
2021-12-10 10:40                     ` Cyril Hrubis
2021-12-10 10:45                       ` Cyril Hrubis
2021-12-13  8:50                       ` Richard Palethorpe [this message]
2021-11-27  0:04 ` [LTP] [PATCH 2/4] controllers/memcg: Skip functional tests when mounted under cgroup2 hierarchy Luke Nowakowski-Krijger
2021-11-27  0:04 ` [LTP] [PATCH 3/4] controllers/cgroup_fj: Update cgroup_fj_common to work under cgroup2 Luke Nowakowski-Krijger
2021-11-27  0:04 ` [LTP] [PATCH 4/4] controllers/cgroup_fj: Update cgroup_fj_function " Luke Nowakowski-Krijger

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=87pmq0ajnw.fsf@suse.de \
    --to=rpalethorpe@suse.de \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=luke.nowakowskikrijger@canonical.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