Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] xfstests: add a CGROUP configuration option
Date: Tue, 18 Feb 2020 10:40:32 -0500
Message-ID: <20200218154032.GA14734@bfoster> (raw)
In-Reply-To: <ad711a8b-f79d-380a-dc11-7e6d1e1e79ba@toxicpanda.com>

On Tue, Feb 18, 2020 at 09:17:10AM -0500, Josef Bacik wrote:
> On 2/17/20 11:38 AM, Brian Foster wrote:
> > On Fri, Feb 14, 2020 at 03:34:31PM -0500, Josef Bacik wrote:
> > > I want to add some extended statistic gathering for xfstests, but it's
> > > tricky to isolate xfstests from the rest of the host applications.  The
> > > most straightforward way to do this is to run every test inside of it's
> > > own cgroup.  From there we can monitor the activity of tasks in the
> > > specific cgroup using BPF.
> > > 
> > 
> > I'm curious what kind of info you're looking for from tests..
> > 
> 
> Latencies.  We have all of these tests doing all sorts of interesting
> things, I want to track operation latencies with code we're actually testing
> so I can see if I've introduced a performance regression somewhere.  Since
> Facebook's whole fleet is on btrfs I want to make sure I'm only getting
> information from things being run by xfstests so I can easily go back and
> hunt down regressions that get introduced.  With BPF I can filter on cgroup
> membership, so I know I'm only recording stats I care about.
> 

Interesting, might be useful to document the use case in the commit log.

> > > The support for this is pretty simple, allow users to specify
> > > CGROUP=/path/to/cgroup.  We will create the path if it doesn't already
> > > exist, and validate we can add things to cgroup.procs.  If we cannot
> > > it'll be disabled, otherwise we will use this when we do _run_seq by
> > > echo'ing the bash pid into cgroup.procs, which will cause any children
> > > to run under that cgroup.
> > > 
> > 
> > Seems reasonable, but is there any opportunity to combine this with what
> > we have in common/cgroup2? It's not clear to me if this cares about
> > cgroup v1 or v2, but perhaps the cgroup2 checks could be built on top of
> > a generic CGROUP var? I'm also wondering if we'd want to change runtime
> > behavior purely based on the existence of the path as opposed to some
> > kind of separate knob (in the event some future test requires the path
> > for some reason without wanting to enable this mechanism).
> > 
> 
> Oh I probably should have looked around, yeah we can definitely use this.
> My initial thought is to just make CGROUP2_PATH exported always, we create
> /path/to/cgroup2/xfstests and point CGROUP2_PATH at that, and then any tests
> that use the cgroup2 path for their test will automatically be populated
> under that global xfstests directory, so I can still capture them with my
> scripts. Does that sound reasonable?  Thanks,
> 

Not sure I follow.. are you saying that we'd change CGROUP2_PATH from
simply pointing at the local cgroup2 root on the local box to some magic
field that directs creation of a cgroup for the particular test? Or did
you mean to use a different variable name in the second case? Maybe it's
just easier to see a patch...

Brian

> Josef
> 


      reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 20:34 Josef Bacik
2020-02-17 16:38 ` Brian Foster
2020-02-18 14:17   ` Josef Bacik
2020-02-18 15:40     ` Brian Foster [this message]

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=20200218154032.GA14734@bfoster \
    --to=bfoster@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.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

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git