From: Stephen Rothwell Date: Mon, 31 Jul 2023 02:41:49 +0000 (+1000) Subject: Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a99e30991d28cc6cf48f0919d9b6d83107ae69a3;p=users%2Fwilly%2Fpagecache.git Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git --- a99e30991d28cc6cf48f0919d9b6d83107ae69a3 diff --cc kernel/cgroup/cgroup.c index 5fa95f86cb4dd,c7aafb59ecf24..c2c97529235aa --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@@ -3654,9 -3632,32 +3654,10 @@@ static int cgroup_stat_show(struct seq_ return 0; } - static int __maybe_unused cgroup_extra_stat_show(struct seq_file *seq, - struct cgroup *cgrp, int ssid) + #ifdef CONFIG_CGROUP_SCHED -/** - * cgroup_tryget_css - try to get a cgroup's css for the specified subsystem - * @cgrp: the cgroup of interest - * @ss: the subsystem of interest - * - * Find and get @cgrp's css associated with @ss. If the css doesn't exist - * or is offline, %NULL is returned. - */ -static struct cgroup_subsys_state *cgroup_tryget_css(struct cgroup *cgrp, - struct cgroup_subsys *ss) -{ - struct cgroup_subsys_state *css; - - rcu_read_lock(); - css = cgroup_css(cgrp, ss); - if (css && !css_tryget_online(css)) - css = NULL; - rcu_read_unlock(); - - return css; -} - + static int cgroup_extra_stat_show(struct seq_file *seq, int ssid) { + struct cgroup *cgrp = seq_css(seq)->cgroup; struct cgroup_subsys *ss = cgroup_subsys[ssid]; struct cgroup_subsys_state *css; int ret; diff --cc tools/testing/selftests/cgroup/.gitignore index 4d556df4f77b6,8443a8d46a1c6..af8c3f30b9c1c --- a/tools/testing/selftests/cgroup/.gitignore +++ b/tools/testing/selftests/cgroup/.gitignore @@@ -5,5 -5,5 +5,6 @@@ test_freeze test_kmem test_kill test_cpu + test_cpuset +test_zswap wait_inotify diff --cc tools/testing/selftests/cgroup/Makefile index 27dbdd7bb4bb6,dee0f013c7f40..c27f05f6ce9b8 --- a/tools/testing/selftests/cgroup/Makefile +++ b/tools/testing/selftests/cgroup/Makefile @@@ -12,7 -12,7 +12,8 @@@ TEST_GEN_PROGS += test_cor TEST_GEN_PROGS += test_freezer TEST_GEN_PROGS += test_kill TEST_GEN_PROGS += test_cpu + TEST_GEN_PROGS += test_cpuset +TEST_GEN_PROGS += test_zswap LOCAL_HDRS += $(selfdir)/clone3/clone3_selftests.h $(selfdir)/pidfd/pidfd.h @@@ -24,4 -24,4 +25,5 @@@ $(OUTPUT)/test_core: cgroup_util. $(OUTPUT)/test_freezer: cgroup_util.c $(OUTPUT)/test_kill: cgroup_util.c $(OUTPUT)/test_cpu: cgroup_util.c + $(OUTPUT)/test_cpuset: cgroup_util.c +$(OUTPUT)/test_zswap: cgroup_util.c