• Home
  • Raw
  • Download

Lines Matching refs:freezer

44 struct freezer {  struct
51 static inline struct freezer *css_freezer(struct cgroup_subsys_state *css) in css_freezer() argument
53 return css ? container_of(css, struct freezer, css) : NULL; in css_freezer()
56 static inline struct freezer *task_freezer(struct task_struct *task) in task_freezer()
61 static struct freezer *parent_freezer(struct freezer *freezer) in parent_freezer() argument
63 return css_freezer(freezer->css.parent); in parent_freezer()
95 struct freezer *freezer; in freezer_css_alloc() local
97 freezer = kzalloc(sizeof(struct freezer), GFP_KERNEL); in freezer_css_alloc()
98 if (!freezer) in freezer_css_alloc()
101 return &freezer->css; in freezer_css_alloc()
114 struct freezer *freezer = css_freezer(css); in freezer_css_online() local
115 struct freezer *parent = parent_freezer(freezer); in freezer_css_online()
120 freezer->state |= CGROUP_FREEZER_ONLINE; in freezer_css_online()
123 freezer->state |= CGROUP_FREEZING_PARENT | CGROUP_FROZEN; in freezer_css_online()
141 struct freezer *freezer = css_freezer(css); in freezer_css_offline() local
146 if (freezer->state & CGROUP_FREEZING) in freezer_css_offline()
149 freezer->state = 0; in freezer_css_offline()
187 struct freezer *freezer = css_freezer(new_css); in freezer_attach() local
189 if (!(freezer->state & CGROUP_FREEZING)) { in freezer_attach()
195 while (freezer && (freezer->state & CGROUP_FROZEN)) { in freezer_attach()
196 freezer->state &= ~CGROUP_FROZEN; in freezer_attach()
197 freezer = parent_freezer(freezer); in freezer_attach()
217 struct freezer *freezer; in freezer_fork() local
232 freezer = task_freezer(task); in freezer_fork()
233 if (freezer->state & CGROUP_FREEZING) in freezer_fork()
258 struct freezer *freezer = css_freezer(css); in update_if_frozen() local
265 if (!(freezer->state & CGROUP_FREEZING) || in update_if_frozen()
266 (freezer->state & CGROUP_FROZEN)) in update_if_frozen()
272 struct freezer *child = css_freezer(pos); in update_if_frozen()
290 freezer->state |= CGROUP_FROZEN; in update_if_frozen()
322 static void freeze_cgroup(struct freezer *freezer) in freeze_cgroup() argument
327 css_task_iter_start(&freezer->css, 0, &it); in freeze_cgroup()
333 static void unfreeze_cgroup(struct freezer *freezer) in unfreeze_cgroup() argument
338 css_task_iter_start(&freezer->css, 0, &it); in unfreeze_cgroup()
353 static void freezer_apply_state(struct freezer *freezer, bool freeze, in freezer_apply_state() argument
359 if (!(freezer->state & CGROUP_FREEZER_ONLINE)) in freezer_apply_state()
363 if (!(freezer->state & CGROUP_FREEZING)) in freezer_apply_state()
365 freezer->state |= state; in freezer_apply_state()
366 freeze_cgroup(freezer); in freezer_apply_state()
368 bool was_freezing = freezer->state & CGROUP_FREEZING; in freezer_apply_state()
370 freezer->state &= ~state; in freezer_apply_state()
372 if (!(freezer->state & CGROUP_FREEZING)) { in freezer_apply_state()
373 freezer->state &= ~CGROUP_FROZEN; in freezer_apply_state()
376 unfreeze_cgroup(freezer); in freezer_apply_state()
389 static void freezer_change_state(struct freezer *freezer, bool freeze) in freezer_change_state() argument
401 css_for_each_descendant_pre(pos, &freezer->css) { in freezer_change_state()
402 struct freezer *pos_f = css_freezer(pos); in freezer_change_state()
403 struct freezer *parent = parent_freezer(pos_f); in freezer_change_state()
409 if (pos_f == freezer) in freezer_change_state()
446 struct freezer *freezer = css_freezer(css); in freezer_self_freezing_read() local
448 return (bool)(freezer->state & CGROUP_FREEZING_SELF); in freezer_self_freezing_read()
454 struct freezer *freezer = css_freezer(css); in freezer_parent_freezing_read() local
456 return (bool)(freezer->state & CGROUP_FREEZING_PARENT); in freezer_parent_freezing_read()