hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/include/linux/cgroup-defs.h
....@@ -21,7 +21,6 @@
2121 #include <linux/workqueue.h>
2222 #include <linux/bpf-cgroup.h>
2323 #include <linux/psi_types.h>
24
-#include <linux/swork.h>
2524
2625 #ifdef CONFIG_CGROUPS
2726
....@@ -90,6 +89,16 @@
9089 * Enable cpuset controller in v1 cgroup to use v2 behavior.
9190 */
9291 CGRP_ROOT_CPUSET_V2_MODE = (1 << 4),
92
+
93
+ /*
94
+ * Enable legacy local memory.events.
95
+ */
96
+ CGRP_ROOT_MEMORY_LOCAL_EVENTS = (1 << 5),
97
+
98
+ /*
99
+ * Enable recursive subtree protection
100
+ */
101
+ CGRP_ROOT_MEMORY_RECURSIVE_PROT = (1 << 6),
93102 };
94103
95104 /* cftype->flags */
....@@ -100,6 +109,7 @@
100109
101110 CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */
102111 CFTYPE_WORLD_WRITABLE = (1 << 4), /* (DON'T USE FOR NEW FILES) S_IWUGO */
112
+ CFTYPE_DEBUG = (1 << 5), /* create when cgroup_debug */
103113 CFTYPE_PRESSURE = (1 << 6), /* only if pressure feature is enabled */
104114
105115 /* internal flags, do not use outside cgroup core proper */
....@@ -167,7 +177,6 @@
167177
168178 /* percpu_ref killing and RCU release */
169179 struct work_struct destroy_work;
170
- struct swork_event destroy_swork;
171180 struct rcu_work destroy_rwork;
172181
173182 /*
....@@ -273,6 +282,13 @@
273282 struct rcu_head rcu_head;
274283 };
275284
285
+struct ext_css_set {
286
+ struct css_set cset;
287
+
288
+ struct list_head mg_src_preload_node;
289
+ struct list_head mg_dst_preload_node;
290
+};
291
+
276292 struct cgroup_base_stat {
277293 struct task_cputime cputime;
278294 };
....@@ -350,16 +366,6 @@
350366 struct cgroup_subsys_state self;
351367
352368 unsigned long flags; /* "unsigned long" so bitops work */
353
-
354
- /*
355
- * idr allocated in-hierarchy ID.
356
- *
357
- * ID 0 is not used, the ID of the root cgroup is always 1, and a
358
- * new cgroup will be assigned with a smallest available ID.
359
- *
360
- * Allocating/Removing ID must be protected by cgroup_mutex.
361
- */
362
- int id;
363369
364370 /*
365371 * The depth this cgroup is at. The root is at depth zero and each
....@@ -455,7 +461,7 @@
455461 struct list_head rstat_css_list;
456462
457463 /* cgroup basic resource statistics */
458
- struct cgroup_base_stat pending_bstat; /* pending from children */
464
+ struct cgroup_base_stat last_bstat;
459465 struct cgroup_base_stat bstat;
460466 struct prev_cputime prev_cputime; /* for printing out cputime */
461467
....@@ -484,12 +490,8 @@
484490 /* Used to store internal freezer state */
485491 struct cgroup_freezer_state freezer;
486492
487
- ANDROID_KABI_RESERVE(1);
488
- ANDROID_KABI_RESERVE(2);
489
- ANDROID_KABI_RESERVE(3);
490
-
491493 /* ids of the ancestors at each level including self */
492
- int ancestor_ids[];
494
+ u64 ancestor_ids[];
493495 };
494496
495497 /*
....@@ -510,7 +512,7 @@
510512 struct cgroup cgrp;
511513
512514 /* for cgrp->ancestor_ids[0] */
513
- int cgrp_ancestor_id_storage;
515
+ u64 cgrp_ancestor_id_storage;
514516
515517 /* Number of cgroups in the hierarchy, used only for /proc/cgroups */
516518 atomic_t nr_cgrps;
....@@ -520,9 +522,6 @@
520522
521523 /* Hierarchy-specific flags */
522524 unsigned int flags;
523
-
524
- /* IDs for cgroups in this hierarchy */
525
- struct idr cgroup_idr;
526525
527526 /* The path to use for release notifications. */
528527 char release_agent_path[PATH_MAX];
....@@ -625,7 +624,7 @@
625624
626625 /*
627626 * Control Group subsystem type.
628
- * See Documentation/cgroup-v1/cgroups.txt for details
627
+ * See Documentation/admin-guide/cgroup-v1/cgroups.rst for details
629628 */
630629 struct cgroup_subsys {
631630 struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state *parent_css);
....@@ -642,8 +641,9 @@
642641 void (*cancel_attach)(struct cgroup_taskset *tset);
643642 void (*attach)(struct cgroup_taskset *tset);
644643 void (*post_attach)(void);
645
- int (*can_fork)(struct task_struct *task);
646
- void (*cancel_fork)(struct task_struct *task);
644
+ int (*can_fork)(struct task_struct *task,
645
+ struct css_set *cset);
646
+ void (*cancel_fork)(struct task_struct *task, struct css_set *cset);
647647 void (*fork)(struct task_struct *task);
648648 void (*exit)(struct task_struct *task);
649649 void (*release)(struct task_struct *task);
....@@ -798,13 +798,9 @@
798798 union {
799799 #ifdef __LITTLE_ENDIAN
800800 struct {
801
-#ifdef __GENKSYMS__
802
- u8 is_data;
803
-#else
804801 u8 is_data : 1;
805802 u8 no_refcnt : 1;
806803 u8 unused : 6;
807
-#endif
808804 u8 padding;
809805 u16 prioidx;
810806 u32 classid;