Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198726
b: refs/heads/master
c: 5407a56
h: refs/heads/master
v: v3
  • Loading branch information
Phil Carmody authored and Linus Torvalds committed May 27, 2010
1 parent 7abd455 commit d9c6f34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df64f81bb1e01cbef967a96642dacf208acb7e72
refs/heads/master: 5407a56257b6ade44fd9bcac972c99845b7413cd
14 changes: 7 additions & 7 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct mem_cgroup_threshold {
/* For threshold */
struct mem_cgroup_threshold_ary {
/* An array index points to threshold just below usage. */
atomic_t current_threshold;
int current_threshold;
/* Size of entries[] */
unsigned int size;
/* Array of thresholds */
Expand Down Expand Up @@ -3412,7 +3412,7 @@ static void __mem_cgroup_threshold(struct mem_cgroup *memcg, bool swap)
* If it's not true, a threshold was crossed after last
* call of __mem_cgroup_threshold().
*/
i = atomic_read(&t->current_threshold);
i = t->current_threshold;

/*
* Iterate backward over array of thresholds starting from
Expand All @@ -3436,7 +3436,7 @@ static void __mem_cgroup_threshold(struct mem_cgroup *memcg, bool swap)
eventfd_signal(t->entries[i].eventfd, 1);

/* Update current_threshold */
atomic_set(&t->current_threshold, i - 1);
t->current_threshold = i - 1;
unlock:
rcu_read_unlock();
}
Expand Down Expand Up @@ -3528,15 +3528,15 @@ static int mem_cgroup_usage_register_event(struct cgroup *cgrp,
compare_thresholds, NULL);

/* Find current threshold */
atomic_set(&thresholds_new->current_threshold, -1);
thresholds_new->current_threshold = -1;
for (i = 0; i < size; i++) {
if (thresholds_new->entries[i].threshold < usage) {
/*
* thresholds_new->current_threshold will not be used
* until rcu_assign_pointer(), so it's safe to increment
* it here.
*/
atomic_inc(&thresholds_new->current_threshold);
++thresholds_new->current_threshold;
}
}

Expand Down Expand Up @@ -3607,7 +3607,7 @@ static int mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
thresholds_new->size = size;

/* Copy thresholds and find current threshold */
atomic_set(&thresholds_new->current_threshold, -1);
thresholds_new->current_threshold = -1;
for (i = 0, j = 0; i < thresholds->size; i++) {
if (thresholds->entries[i].eventfd == eventfd)
continue;
Expand All @@ -3619,7 +3619,7 @@ static int mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
* until rcu_assign_pointer(), so it's safe to increment
* it here.
*/
atomic_inc(&thresholds_new->current_threshold);
++thresholds_new->current_threshold;
}
j++;
}
Expand Down

0 comments on commit d9c6f34

Please sign in to comment.