| .. | .. |
|---|
| 21 | 21 | #include <linux/workqueue.h> |
|---|
| 22 | 22 | #include <linux/bpf-cgroup.h> |
|---|
| 23 | 23 | #include <linux/psi_types.h> |
|---|
| 24 | | -#include <linux/swork.h> |
|---|
| 25 | 24 | |
|---|
| 26 | 25 | #ifdef CONFIG_CGROUPS |
|---|
| 27 | 26 | |
|---|
| .. | .. |
|---|
| 90 | 89 | * Enable cpuset controller in v1 cgroup to use v2 behavior. |
|---|
| 91 | 90 | */ |
|---|
| 92 | 91 | 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), |
|---|
| 93 | 102 | }; |
|---|
| 94 | 103 | |
|---|
| 95 | 104 | /* cftype->flags */ |
|---|
| .. | .. |
|---|
| 100 | 109 | |
|---|
| 101 | 110 | CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */ |
|---|
| 102 | 111 | CFTYPE_WORLD_WRITABLE = (1 << 4), /* (DON'T USE FOR NEW FILES) S_IWUGO */ |
|---|
| 112 | + CFTYPE_DEBUG = (1 << 5), /* create when cgroup_debug */ |
|---|
| 103 | 113 | CFTYPE_PRESSURE = (1 << 6), /* only if pressure feature is enabled */ |
|---|
| 104 | 114 | |
|---|
| 105 | 115 | /* internal flags, do not use outside cgroup core proper */ |
|---|
| .. | .. |
|---|
| 167 | 177 | |
|---|
| 168 | 178 | /* percpu_ref killing and RCU release */ |
|---|
| 169 | 179 | struct work_struct destroy_work; |
|---|
| 170 | | - struct swork_event destroy_swork; |
|---|
| 171 | 180 | struct rcu_work destroy_rwork; |
|---|
| 172 | 181 | |
|---|
| 173 | 182 | /* |
|---|
| .. | .. |
|---|
| 273 | 282 | struct rcu_head rcu_head; |
|---|
| 274 | 283 | }; |
|---|
| 275 | 284 | |
|---|
| 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 | + |
|---|
| 276 | 292 | struct cgroup_base_stat { |
|---|
| 277 | 293 | struct task_cputime cputime; |
|---|
| 278 | 294 | }; |
|---|
| .. | .. |
|---|
| 350 | 366 | struct cgroup_subsys_state self; |
|---|
| 351 | 367 | |
|---|
| 352 | 368 | 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; |
|---|
| 363 | 369 | |
|---|
| 364 | 370 | /* |
|---|
| 365 | 371 | * The depth this cgroup is at. The root is at depth zero and each |
|---|
| .. | .. |
|---|
| 455 | 461 | struct list_head rstat_css_list; |
|---|
| 456 | 462 | |
|---|
| 457 | 463 | /* cgroup basic resource statistics */ |
|---|
| 458 | | - struct cgroup_base_stat pending_bstat; /* pending from children */ |
|---|
| 464 | + struct cgroup_base_stat last_bstat; |
|---|
| 459 | 465 | struct cgroup_base_stat bstat; |
|---|
| 460 | 466 | struct prev_cputime prev_cputime; /* for printing out cputime */ |
|---|
| 461 | 467 | |
|---|
| .. | .. |
|---|
| 484 | 490 | /* Used to store internal freezer state */ |
|---|
| 485 | 491 | struct cgroup_freezer_state freezer; |
|---|
| 486 | 492 | |
|---|
| 487 | | - ANDROID_KABI_RESERVE(1); |
|---|
| 488 | | - ANDROID_KABI_RESERVE(2); |
|---|
| 489 | | - ANDROID_KABI_RESERVE(3); |
|---|
| 490 | | - |
|---|
| 491 | 493 | /* ids of the ancestors at each level including self */ |
|---|
| 492 | | - int ancestor_ids[]; |
|---|
| 494 | + u64 ancestor_ids[]; |
|---|
| 493 | 495 | }; |
|---|
| 494 | 496 | |
|---|
| 495 | 497 | /* |
|---|
| .. | .. |
|---|
| 510 | 512 | struct cgroup cgrp; |
|---|
| 511 | 513 | |
|---|
| 512 | 514 | /* for cgrp->ancestor_ids[0] */ |
|---|
| 513 | | - int cgrp_ancestor_id_storage; |
|---|
| 515 | + u64 cgrp_ancestor_id_storage; |
|---|
| 514 | 516 | |
|---|
| 515 | 517 | /* Number of cgroups in the hierarchy, used only for /proc/cgroups */ |
|---|
| 516 | 518 | atomic_t nr_cgrps; |
|---|
| .. | .. |
|---|
| 520 | 522 | |
|---|
| 521 | 523 | /* Hierarchy-specific flags */ |
|---|
| 522 | 524 | unsigned int flags; |
|---|
| 523 | | - |
|---|
| 524 | | - /* IDs for cgroups in this hierarchy */ |
|---|
| 525 | | - struct idr cgroup_idr; |
|---|
| 526 | 525 | |
|---|
| 527 | 526 | /* The path to use for release notifications. */ |
|---|
| 528 | 527 | char release_agent_path[PATH_MAX]; |
|---|
| .. | .. |
|---|
| 625 | 624 | |
|---|
| 626 | 625 | /* |
|---|
| 627 | 626 | * Control Group subsystem type. |
|---|
| 628 | | - * See Documentation/cgroup-v1/cgroups.txt for details |
|---|
| 627 | + * See Documentation/admin-guide/cgroup-v1/cgroups.rst for details |
|---|
| 629 | 628 | */ |
|---|
| 630 | 629 | struct cgroup_subsys { |
|---|
| 631 | 630 | struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state *parent_css); |
|---|
| .. | .. |
|---|
| 642 | 641 | void (*cancel_attach)(struct cgroup_taskset *tset); |
|---|
| 643 | 642 | void (*attach)(struct cgroup_taskset *tset); |
|---|
| 644 | 643 | 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); |
|---|
| 647 | 647 | void (*fork)(struct task_struct *task); |
|---|
| 648 | 648 | void (*exit)(struct task_struct *task); |
|---|
| 649 | 649 | void (*release)(struct task_struct *task); |
|---|
| .. | .. |
|---|
| 798 | 798 | union { |
|---|
| 799 | 799 | #ifdef __LITTLE_ENDIAN |
|---|
| 800 | 800 | struct { |
|---|
| 801 | | -#ifdef __GENKSYMS__ |
|---|
| 802 | | - u8 is_data; |
|---|
| 803 | | -#else |
|---|
| 804 | 801 | u8 is_data : 1; |
|---|
| 805 | 802 | u8 no_refcnt : 1; |
|---|
| 806 | 803 | u8 unused : 6; |
|---|
| 807 | | -#endif |
|---|
| 808 | 804 | u8 padding; |
|---|
| 809 | 805 | u16 prioidx; |
|---|
| 810 | 806 | u32 classid; |
|---|