RSSAmplifier

Paul E. McKenney's Journal · Feb 2, 2024

Stupid RCU Tricks: So You Want to Torture RCU With a Non-Trivial Userspace?

0
Sign in to vote or save

paulmck.livejournal.com

In order to save mass-storage space and to reduce boot times, rcutorture runs out of a tiny initrd filesystem that consists only of a root directory and a statically linked init program based on nolibc.  This init program binds itself to a randomly chosen CPU, spins for a short time, sleeps for a short time, and repeats, the point being to inject at least a little userspace execution for the benefit of nohz_full CPUs.

This works very well most of the time.  But what if you want to use a full userspace when torturing RCU, perhaps because you want to test runtime changes to RCU's many sysfs parameters, run heavier userspace loads on nohz_full CPUs, or even to run BPF programs?

What you do is go back to the old way of building rcutorture's initrd.

Which raises the question as to what the new way might be.

What rcutorture does is to look at the tools/testing/selftests/rcutorture/initr d directory.  If this directory does not already a file named init, the tools/testing/selftests/rcutorture/bin/m kinitrd.sh script builds the aforementioned statically linked init program.

Which means that you can put whatever initrd file tree you wish into that initrd directory, and as long as it contains a /init program, rcutorture will happily bundle that file tree into an initrd in each the resulting rcutorture kernel images.

And back in the old days, that is exactly what I did.  I grabbed any convenient initrd and expanded it into my tools/testing/selftests/rcutorture/initr d directory.  This still works, so you can do this too!

LJ Video

Read the original on paulmck.livejournal.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.