hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/cgroup-defs.h
....@@ -89,6 +89,16 @@
8989 * Enable cpuset controller in v1 cgroup to use v2 behavior.
9090 */
9191 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),
92102 };
93103
94104 /* cftype->flags */
....@@ -99,6 +109,7 @@
99109
100110 CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */
101111 CFTYPE_WORLD_WRITABLE = (1 << 4), /* (DON'T USE FOR NEW FILES) S_IWUGO */
112
+ CFTYPE_DEBUG = (1 << 5), /* create when cgroup_debug */
102113 CFTYPE_PRESSURE = (1 << 6), /* only if pressure feature is enabled */
103114
104115 /* internal flags, do not use outside cgroup core proper */
....@@ -271,6 +282,13 @@
271282 struct rcu_head rcu_head;
272283 };
273284
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
+
274292 struct cgroup_base_stat {
275293 struct task_cputime cputime;
276294 };
....@@ -348,16 +366,6 @@
348366 struct cgroup_subsys_state self;
349367
350368 unsigned long flags; /* "unsigned long" so bitops work */
351
-
352
- /*
353
- * idr allocated in-hierarchy ID.
354
- *
355
- * ID 0 is not used, the ID of the root cgroup is always 1, and a
356
- * new cgroup will be assigned with a smallest available ID.
357
- *
358
- * Allocating/Removing ID must be protected by cgroup_mutex.
359
- */
360
- int id;
361369
362370 /*
363371 * The depth this cgroup is at. The root is at depth zero and each
....@@ -453,7 +461,7 @@
453461 struct list_head rstat_css_list;
454462
455463 /* cgroup basic resource statistics */
456
- struct cgroup_base_stat pending_bstat; /* pending from children */
464
+ struct cgroup_base_stat last_bstat;
457465 struct cgroup_base_stat bstat;
458466 struct prev_cputime prev_cputime; /* for printing out cputime */
459467
....@@ -482,12 +490,8 @@
482490 /* Used to store internal freezer state */
483491 struct cgroup_freezer_state freezer;
484492
485
- ANDROID_KABI_RESERVE(1);
486
- ANDROID_KABI_RESERVE(2);
487
- ANDROID_KABI_RESERVE(3);
488
-
489493 /* ids of the ancestors at each level including self */
490
- int ancestor_ids[];
494
+ u64 ancestor_ids[];
491495 };
492496
493497 /*
....@@ -508,7 +512,7 @@
508512 struct cgroup cgrp;
509513
510514 /* for cgrp->ancestor_ids[0] */
511
- int cgrp_ancestor_id_storage;
515
+ u64 cgrp_ancestor_id_storage;
512516
513517 /* Number of cgroups in the hierarchy, used only for /proc/cgroups */
514518 atomic_t nr_cgrps;
....@@ -518,9 +522,6 @@
518522
519523 /* Hierarchy-specific flags */
520524 unsigned int flags;
521
-
522
- /* IDs for cgroups in this hierarchy */
523
- struct idr cgroup_idr;
524525
525526 /* The path to use for release notifications. */
526527 char release_agent_path[PATH_MAX];
....@@ -623,7 +624,7 @@
623624
624625 /*
625626 * Control Group subsystem type.
626
- * See Documentation/cgroup-v1/cgroups.txt for details
627
+ * See Documentation/admin-guide/cgroup-v1/cgroups.rst for details
627628 */
628629 struct cgroup_subsys {
629630 struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state *parent_css);
....@@ -640,8 +641,9 @@
640641 void (*cancel_attach)(struct cgroup_taskset *tset);
641642 void (*attach)(struct cgroup_taskset *tset);
642643 void (*post_attach)(void);
643
- int (*can_fork)(struct task_struct *task);
644
- 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);
645647 void (*fork)(struct task_struct *task);
646648 void (*exit)(struct task_struct *task);
647649 void (*release)(struct task_struct *task);
....@@ -796,13 +798,9 @@
796798 union {
797799 #ifdef __LITTLE_ENDIAN
798800 struct {
799
-#ifdef __GENKSYMS__
800
- u8 is_data;
801
-#else
802801 u8 is_data : 1;
803802 u8 no_refcnt : 1;
804803 u8 unused : 6;
805
-#endif
806804 u8 padding;
807805 u16 prioidx;
808806 u32 classid;