Lines Matching defs:thresholds
10 * Memory thresholds
4238 t = rcu_dereference(memcg->thresholds.primary);
4255 * Iterate backward over array of thresholds starting from
4257 * If none of thresholds below usage is crossed, we read
4267 * Iterate forward over array of thresholds starting from
4269 * If none of thresholds above usage is crossed, we read
4330 struct mem_cgroup_thresholds *thresholds;
4343 thresholds = &memcg->thresholds;
4346 thresholds = &memcg->memsw_thresholds;
4352 if (thresholds->primary)
4355 size = thresholds->primary ? thresholds->primary->size + 1 : 1;
4357 /* Allocate memory for new array of thresholds */
4365 /* Copy thresholds (if any) to new array */
4366 if (thresholds->primary)
4367 memcpy(new->entries, thresholds->primary->entries,
4374 /* Sort thresholds. Registering of new threshold isn't time-critical */
4393 kfree(thresholds->spare);
4394 thresholds->spare = thresholds->primary;
4396 rcu_assign_pointer(thresholds->primary, new);
4398 /* To be sure that nobody uses thresholds */
4422 struct mem_cgroup_thresholds *thresholds;
4430 thresholds = &memcg->thresholds;
4433 thresholds = &memcg->memsw_thresholds;
4438 if (!thresholds->primary)
4446 for (i = 0; i < thresholds->primary->size; i++) {
4447 if (thresholds->primary->entries[i].eventfd != eventfd)
4453 new = thresholds->spare;
4459 /* Set thresholds array to NULL if we don't have thresholds */
4468 /* Copy thresholds and find current threshold */
4470 for (i = 0, j = 0; i < thresholds->primary->size; i++) {
4471 if (thresholds->primary->entries[i].eventfd == eventfd)
4474 new->entries[j] = thresholds->primary->entries[i];
4488 thresholds->spare = thresholds->primary;
4490 rcu_assign_pointer(thresholds->primary, new);
4492 /* To be sure that nobody uses thresholds */
4497 kfree(thresholds->spare);
4498 thresholds->spare = NULL;