public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: James Houghton <jthoughton@google.com>
Cc: kvm@vger.kernel.org, Maxim Levitsky <mlevitsk@redhat.com>,
	 Axel Rasmussen <axelrasmussen@google.com>,
	Tejun Heo <tj@kernel.org>,  Johannes Weiner <hannes@cmpxchg.org>,
	mkoutny@suse.com, Yosry Ahmed <yosry.ahmed@linux.dev>,
	 Yu Zhao <yuzhao@google.com>, David Matlack <dmatlack@google.com>,
	cgroups@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/5] KVM: selftests: access_tracking_perf_test: Use MGLRU for access tracking
Date: Fri, 25 Apr 2025 17:31:23 -0700	[thread overview]
Message-ID: <aAwpWwMIJEjtL5F9@google.com> (raw)
In-Reply-To: <20250414200929.3098202-6-jthoughton@google.com>

On Mon, Apr 14, 2025, James Houghton wrote:
> By using MGLRU's debugfs for invoking test_young() and clear_young(), we
> avoid page_idle's incompatibility with MGLRU, and we can mark pages as
> idle (clear_young()) much faster.
> 
> The ability to use page_idle is left in, as it is useful for kernels
> that do not have MGLRU built in. If MGLRU is enabled but is not usable
> (e.g. we can't access the debugfs mount), the test will fail, as
> page_idle is not compatible with MGLRU.
> 
> cgroup utility functions have been borrowed so that, when running with
> MGLRU, we can create a memcg in which to run our test.
> 
> Other MGLRU-debugfs-specific parsing code has been added to
> lru_gen_util.{c,h}.

This fails on my end due to not being able to find the cgroup.  I spent about 15
minutes poking at it and gave it.  FWIW, this is on our devrez hosts, so it's
presumably similar hardware to what you tested on.

Even if this turns out to be PEBKAC or some CONFIG_XXX incompatibility, there
needs to be better hints provided to the user of how they can some this.

And this would be a perfect opportunity to clean up this:

 	__TEST_REQUIRE(page_idle_fd >= 0,
		       "CONFIG_IDLE_PAGE_TRACKING is not enabled");

I can't count the number of times I've forgotten to run the test with root
privileges, and wasted a bunch of time remembering it's not that the kernel
doesn't have CONFIG_IDLE_PAGE_TRACKING, but that /sys/kernel/mm/page_idle/bitmap
isn't accessible.

I mention that, because on a kernel with MGRLU available but disabled, and
CONFIG_IDLE_PAGE_TRACKING=n, the user has no idea that they _can_ run the test
without mucking with their kernel.

==== Test Assertion Failure ====
  lib/lru_gen_util.c:229: stats->memcg_id > 0
  pid=423298 tid=423298 errno=2 - No such file or directory
     1	0x0000000000408b45: lru_gen_read_memcg_stats at lru_gen_util.c:229
     2	0x0000000000402e4c: run_test at access_tracking_perf_test.c:421
     3	0x0000000000403694: for_each_guest_mode at guest_modes.c:96
     4	0x00000000004023dd: run_test_in_cg at access_tracking_perf_test.c:467
     5	0x000000000041ba65: cg_run at cgroup_util.c:362
     6	0x0000000000402042: main at access_tracking_perf_test.c:583
     7	0x000000000041c753: __libc_start_call_main at libc-start.o:?
     8	0x000000000041e9ac: __libc_start_main_impl at ??:?
     9	0x0000000000402280: _start at ??:?
  Couldn't find memcg: access_tracking_perf_test
Did the memcg get created in the proper mount?
Destroying cgroup: /sys/fs/cgroup/access_tracking_perf_test

  reply	other threads:[~2025-04-26  0:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 20:09 [PATCH v3 0/5] KVM: selftests: access_tracking_perf_test fixes for NUMA balancing and MGLRU James Houghton
2025-04-14 20:09 ` [PATCH v3 1/5] KVM: selftests: Extract guts of THP accessor to standalone sysfs helpers James Houghton
2025-04-14 20:09 ` [PATCH v3 2/5] KVM: selftests: access_tracking_perf_test: Add option to skip the sanity check James Houghton
2025-04-14 20:09 ` [PATCH v3 3/5] cgroup: selftests: Move cgroup_util into its own library James Houghton
2025-04-14 20:25   ` James Houghton
2025-04-14 20:09 ` [PATCH v3 4/5] KVM: selftests: Build and link selftests/cgroup/lib into KVM selftests James Houghton
2025-04-29  1:03   ` Sean Christopherson
2025-04-29 12:05     ` Michal Koutný
2025-04-14 20:09 ` [PATCH v3 5/5] KVM: selftests: access_tracking_perf_test: Use MGLRU for access tracking James Houghton
2025-04-26  0:31   ` Sean Christopherson [this message]
2025-04-28 19:54     ` James Houghton
2025-04-29  0:56       ` Sean Christopherson
2025-04-29  1:19   ` Sean Christopherson
2025-04-29 22:55     ` James Houghton
2025-04-30 21:41       ` Sean Christopherson

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=aAwpWwMIJEjtL5F9@google.com \
    --to=seanjc@google.com \
    --cc=axelrasmussen@google.com \
    --cc=cgroups@vger.kernel.org \
    --cc=dmatlack@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=jthoughton@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkoutny@suse.com \
    --cc=mlevitsk@redhat.com \
    --cc=tj@kernel.org \
    --cc=yosry.ahmed@linux.dev \
    --cc=yuzhao@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