Lines Matching refs:freezer

43 struct freezer {  struct
50 static inline struct freezer *css_freezer(struct cgroup_subsys_state *css) in css_freezer() argument
52 return css ? container_of(css, struct freezer, css) : NULL; in css_freezer()
55 static inline struct freezer *task_freezer(struct task_struct *task) in task_freezer()
60 static struct freezer *parent_freezer(struct freezer *freezer) in parent_freezer() argument
62 return css_freezer(freezer->css.parent); in parent_freezer()
88 struct freezer *freezer; in freezer_css_alloc() local
90 freezer = kzalloc(sizeof(struct freezer), GFP_KERNEL); in freezer_css_alloc()
91 if (!freezer) in freezer_css_alloc()
94 return &freezer->css; in freezer_css_alloc()
107 struct freezer *freezer = css_freezer(css); in freezer_css_online() local
108 struct freezer *parent = parent_freezer(freezer); in freezer_css_online()
112 freezer->state |= CGROUP_FREEZER_ONLINE; in freezer_css_online()
115 freezer->state |= CGROUP_FREEZING_PARENT | CGROUP_FROZEN; in freezer_css_online()
132 struct freezer *freezer = css_freezer(css); in freezer_css_offline() local
136 if (freezer->state & CGROUP_FREEZING) in freezer_css_offline()
139 freezer->state = 0; in freezer_css_offline()
176 struct freezer *freezer = css_freezer(new_css); in freezer_attach() local
178 if (!(freezer->state & CGROUP_FREEZING)) { in freezer_attach()
183 while (freezer && (freezer->state & CGROUP_FROZEN)) { in freezer_attach()
184 freezer->state &= ~CGROUP_FROZEN; in freezer_attach()
185 freezer = parent_freezer(freezer); in freezer_attach()
205 struct freezer *freezer; in freezer_fork() local
220 freezer = task_freezer(task); in freezer_fork()
221 if (freezer->state & CGROUP_FREEZING) in freezer_fork()
246 struct freezer *freezer = css_freezer(css); in update_if_frozen() local
253 if (!(freezer->state & CGROUP_FREEZING) || in update_if_frozen()
254 (freezer->state & CGROUP_FROZEN)) in update_if_frozen()
260 struct freezer *child = css_freezer(pos); in update_if_frozen()
286 freezer->state |= CGROUP_FROZEN; in update_if_frozen()
318 static void freeze_cgroup(struct freezer *freezer) in freeze_cgroup() argument
323 css_task_iter_start(&freezer->css, 0, &it); in freeze_cgroup()
329 static void unfreeze_cgroup(struct freezer *freezer) in unfreeze_cgroup() argument
334 css_task_iter_start(&freezer->css, 0, &it); in unfreeze_cgroup()
349 static void freezer_apply_state(struct freezer *freezer, bool freeze, in freezer_apply_state() argument
355 if (!(freezer->state & CGROUP_FREEZER_ONLINE)) in freezer_apply_state()
359 if (!(freezer->state & CGROUP_FREEZING)) in freezer_apply_state()
361 freezer->state |= state; in freezer_apply_state()
362 freeze_cgroup(freezer); in freezer_apply_state()
364 bool was_freezing = freezer->state & CGROUP_FREEZING; in freezer_apply_state()
366 freezer->state &= ~state; in freezer_apply_state()
368 if (!(freezer->state & CGROUP_FREEZING)) { in freezer_apply_state()
371 freezer->state &= ~CGROUP_FROZEN; in freezer_apply_state()
372 unfreeze_cgroup(freezer); in freezer_apply_state()
385 static void freezer_change_state(struct freezer *freezer, bool freeze) in freezer_change_state() argument
396 css_for_each_descendant_pre(pos, &freezer->css) { in freezer_change_state()
397 struct freezer *pos_f = css_freezer(pos); in freezer_change_state()
398 struct freezer *parent = parent_freezer(pos_f); in freezer_change_state()
404 if (pos_f == freezer) in freezer_change_state()
440 struct freezer *freezer = css_freezer(css); in freezer_self_freezing_read() local
442 return (bool)(freezer->state & CGROUP_FREEZING_SELF); in freezer_self_freezing_read()
448 struct freezer *freezer = css_freezer(css); in freezer_parent_freezing_read() local
450 return (bool)(freezer->state & CGROUP_FREEZING_PARENT); in freezer_parent_freezing_read()