favordynmods prioritizes cgroup writes over reads. Before commit
0568f89d4f ("cgroup: replace global percpu_rwsem with per threadgroup
resem when writing to cgroup.procs") first introduced in the 6.18
kernel, this effectively meant replacing the percpu_rwsem fast path with
a global lock (percpu_rwsem slowpath) for readers to allow speeding up
writers. This forced all fork()s and exit()s globally down the slow
path. After commit 0568f89d4f that is no longer the case, and the
write side of the lock is much more narrow at per-threadgroup scope
instead of global, drastically reducing contention.
So we want to use favordynmods only on kernels that have commit
0568f89d4f. A runtime check for the presence of commit 0568f89d4f is
possible, but awkward and potentially slow depending on how it's done. A
better alternative is to simply enable CONFIG_CGROUP_FAVOR_DYNMODS on
kernels where we know commit 0568f89d4f is present.
Bug: 543503146
Change-Id: I511223793adeab7263635895a467a15258086a23
Signed-off-by: T.J. Mercier <tjmercier@google.com>