Lines Matching defs:thresholds
10 * Memory thresholds
4242 t = rcu_dereference(memcg->thresholds.primary);
4259 * Iterate backward over array of thresholds starting from
4261 * If none of thresholds below usage is crossed, we read
4271 * Iterate forward over array of thresholds starting from
4273 * If none of thresholds above usage is crossed, we read
4334 struct mem_cgroup_thresholds *thresholds;
4347 thresholds = &memcg->thresholds;
4350 thresholds = &memcg->memsw_thresholds;
4356 if (thresholds->primary)
4359 size = thresholds->primary ? thresholds->primary->size + 1 : 1;
4361 /* Allocate memory for new array of thresholds */
4369 /* Copy thresholds (if any) to new array */
4370 if (thresholds->primary)
4371 memcpy(new->entries, thresholds->primary->entries,
4378 /* Sort thresholds. Registering of new threshold isn't time-critical */
4397 kfree(thresholds->spare);
4398 thresholds->spare = thresholds->primary;
4400 rcu_assign_pointer(thresholds->primary, new);
4402 /* To be sure that nobody uses thresholds */
4426 struct mem_cgroup_thresholds *thresholds;
4434 thresholds = &memcg->thresholds;
4437 thresholds = &memcg->memsw_thresholds;
4442 if (!thresholds->primary)
4450 for (i = 0; i < thresholds->primary->size; i++) {
4451 if (thresholds->primary->entries[i].eventfd != eventfd)
4457 new = thresholds->spare;
4463 /* Set thresholds array to NULL if we don't have thresholds */
4472 /* Copy thresholds and find current threshold */
4474 for (i = 0, j = 0; i < thresholds->primary->size; i++) {
4475 if (thresholds->primary->entries[i].eventfd == eventfd)
4478 new->entries[j] = thresholds->primary->entries[i];
4492 thresholds->spare = thresholds->primary;
4494 rcu_assign_pointer(thresholds->primary, new);
4496 /* To be sure that nobody uses thresholds */
4501 kfree(thresholds->spare);
4502 thresholds->spare = NULL;