Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308904
b: refs/heads/master
c: 748dad3
h: refs/heads/master
v: v3
  • Loading branch information
Sha Zhengju authored and Linus Torvalds committed May 29, 2012
1 parent 6d630d1 commit 409b837
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: a0db00fcf5da79911b7ff2db63ea7c0a5711e096
refs/heads/master: 748dad36d645f5c4517a115d60bb3a0e8f877ac0
11 changes: 6 additions & 5 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct mem_cgroup_threshold {

/* For threshold */
struct mem_cgroup_threshold_ary {
/* An array index points to threshold just below usage. */
/* An array index points to threshold just below or equal to usage. */
int current_threshold;
/* Size of entries[] */
unsigned int size;
Expand Down Expand Up @@ -4280,7 +4280,7 @@ static void __mem_cgroup_threshold(struct mem_cgroup *memcg, bool swap)
usage = mem_cgroup_usage(memcg, swap);

/*
* current_threshold points to threshold just below usage.
* current_threshold points to threshold just below or equal to usage.
* If it's not true, a threshold was crossed after last
* call of __mem_cgroup_threshold().
*/
Expand Down Expand Up @@ -4406,14 +4406,15 @@ static int mem_cgroup_usage_register_event(struct cgroup *cgrp,
/* Find current threshold */
new->current_threshold = -1;
for (i = 0; i < size; i++) {
if (new->entries[i].threshold < usage) {
if (new->entries[i].threshold <= usage) {
/*
* new->current_threshold will not be used until
* rcu_assign_pointer(), so it's safe to increment
* it here.
*/
++new->current_threshold;
}
} else
break;
}

/* Free old spare buffer and save old primary buffer as spare */
Expand Down Expand Up @@ -4482,7 +4483,7 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
continue;

new->entries[j] = thresholds->primary->entries[i];
if (new->entries[j].threshold < usage) {
if (new->entries[j].threshold <= usage) {
/*
* new->current_threshold will not be used
* until rcu_assign_pointer(), so it's safe to increment
Expand Down

0 comments on commit 409b837

Please sign in to comment.