Commit 8b49c4b1 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup

Pull cgroup updates from Tejun Heo:
 "Nothing too interesting. This adds cpu controller selftests and there
  are a couple code cleanup patches"

* 'for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
  cgroup: remove the superfluous judgment
  cgroup: Make cgroup_debug static
  kseltest/cgroup: Make test_stress.sh work if run interactively
  kselftest/cgroup: fix test_stress.sh to use OUTPUT dir
  cgroup: Add config file to cgroup selftest suite
  cgroup: Add test_cpucg_max_nested() testcase
  cgroup: Add test_cpucg_max() testcase
  cgroup: Add test_cpucg_nested_weight_underprovisioned() testcase
  cgroup: Adding test_cpucg_nested_weight_overprovisioned() testcase
  cgroup: Add test_cpucg_weight_underprovisioned() testcase
  cgroup: Add test_cpucg_weight_overprovisioned() testcase
  cgroup: Add test_cpucg_stats() testcase to cgroup cpu selftests
  cgroup: Add new test_cpu.c test suite in cgroup selftests
parents 64e34b50 b154a017
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#define TRACE_CGROUP_PATH_LEN 1024 #define TRACE_CGROUP_PATH_LEN 1024
extern spinlock_t trace_cgroup_path_lock; extern spinlock_t trace_cgroup_path_lock;
extern char trace_cgroup_path[TRACE_CGROUP_PATH_LEN]; extern char trace_cgroup_path[TRACE_CGROUP_PATH_LEN];
extern bool cgroup_debug;
extern void __init enable_debug_cgroup(void); extern void __init enable_debug_cgroup(void);
/* /*
......
...@@ -96,7 +96,7 @@ EXPORT_SYMBOL_GPL(css_set_lock); ...@@ -96,7 +96,7 @@ EXPORT_SYMBOL_GPL(css_set_lock);
DEFINE_SPINLOCK(trace_cgroup_path_lock); DEFINE_SPINLOCK(trace_cgroup_path_lock);
char trace_cgroup_path[TRACE_CGROUP_PATH_LEN]; char trace_cgroup_path[TRACE_CGROUP_PATH_LEN];
bool cgroup_debug __read_mostly; static bool cgroup_debug __read_mostly;
/* /*
* Protects cgroup_idr and css_idr so that IDs can be released without * Protects cgroup_idr and css_idr so that IDs can be released without
...@@ -5685,7 +5685,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp) ...@@ -5685,7 +5685,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
css_clear_dir(&cgrp->self); css_clear_dir(&cgrp->self);
kernfs_remove(cgrp->kn); kernfs_remove(cgrp->kn);
if (parent && cgroup_is_threaded(cgrp)) if (cgroup_is_threaded(cgrp))
parent->nr_threaded_children--; parent->nr_threaded_children--;
spin_lock_irq(&css_set_lock); spin_lock_irq(&css_set_lock);
......
...@@ -4,3 +4,4 @@ test_core ...@@ -4,3 +4,4 @@ test_core
test_freezer test_freezer
test_kmem test_kmem
test_kill test_kill
test_cpu
...@@ -10,6 +10,7 @@ TEST_GEN_PROGS += test_kmem ...@@ -10,6 +10,7 @@ TEST_GEN_PROGS += test_kmem
TEST_GEN_PROGS += test_core TEST_GEN_PROGS += test_core
TEST_GEN_PROGS += test_freezer TEST_GEN_PROGS += test_freezer
TEST_GEN_PROGS += test_kill TEST_GEN_PROGS += test_kill
TEST_GEN_PROGS += test_cpu
LOCAL_HDRS += $(selfdir)/clone3/clone3_selftests.h $(selfdir)/pidfd/pidfd.h LOCAL_HDRS += $(selfdir)/clone3/clone3_selftests.h $(selfdir)/pidfd/pidfd.h
...@@ -20,3 +21,4 @@ $(OUTPUT)/test_kmem: cgroup_util.c ...@@ -20,3 +21,4 @@ $(OUTPUT)/test_kmem: cgroup_util.c
$(OUTPUT)/test_core: cgroup_util.c $(OUTPUT)/test_core: cgroup_util.c
$(OUTPUT)/test_freezer: cgroup_util.c $(OUTPUT)/test_freezer: cgroup_util.c
$(OUTPUT)/test_kill: cgroup_util.c $(OUTPUT)/test_kill: cgroup_util.c
$(OUTPUT)/test_cpu: cgroup_util.c
...@@ -190,6 +190,18 @@ int cg_write(const char *cgroup, const char *control, char *buf) ...@@ -190,6 +190,18 @@ int cg_write(const char *cgroup, const char *control, char *buf)
return -1; return -1;
} }
int cg_write_numeric(const char *cgroup, const char *control, long value)
{
char buf[64];
int ret;
ret = sprintf(buf, "%lu", value);
if (ret < 0)
return ret;
return cg_write(cgroup, control, buf);
}
int cg_find_unified_root(char *root, size_t len) int cg_find_unified_root(char *root, size_t len)
{ {
char buf[10 * PAGE_SIZE]; char buf[10 * PAGE_SIZE];
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#define MB(x) (x << 20) #define MB(x) (x << 20)
#define USEC_PER_SEC 1000000L
#define NSEC_PER_SEC 1000000000L
/* /*
* Checks if two given values differ by less than err% of their sum. * Checks if two given values differ by less than err% of their sum.
*/ */
...@@ -32,6 +35,7 @@ extern long cg_read_long(const char *cgroup, const char *control); ...@@ -32,6 +35,7 @@ extern long cg_read_long(const char *cgroup, const char *control);
long cg_read_key_long(const char *cgroup, const char *control, const char *key); long cg_read_key_long(const char *cgroup, const char *control, const char *key);
extern long cg_read_lc(const char *cgroup, const char *control); extern long cg_read_lc(const char *cgroup, const char *control);
extern int cg_write(const char *cgroup, const char *control, char *buf); extern int cg_write(const char *cgroup, const char *control, char *buf);
int cg_write_numeric(const char *cgroup, const char *control, long value);
extern int cg_run(const char *cgroup, extern int cg_run(const char *cgroup,
int (*fn)(const char *cgroup, void *arg), int (*fn)(const char *cgroup, void *arg),
void *arg); void *arg);
......
CONFIG_CGROUPS=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_SCHED=y
CONFIG_MEMCG=y
CONFIG_MEMCG_KMEM=y
CONFIG_MEMCG_SWAP=y
CONFIG_PAGE_COUNTER=y
This diff is collapsed.
#!/bin/bash #!/bin/bash
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
./with_stress.sh -s subsys -s fork ./test_core ./with_stress.sh -s subsys -s fork ${OUTPUT:-.}/test_core
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment