summaryrefslogtreecommitdiffstats
path: root/mm/page_counter.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2014-12-10 15:42:45 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 17:41:05 -0800
commit64f2199389414341ed3a570663f23616c131ba25 (patch)
tree18155a07f37431fb3f2abb7b367686e71376edf3 /mm/page_counter.c
parente8ea14cc6eadfe2ea63e9989e16e62625a2619f8 (diff)
downloadop-kernel-dev-64f2199389414341ed3a570663f23616c131ba25.zip
op-kernel-dev-64f2199389414341ed3a570663f23616c131ba25.tar.gz
mm: memcontrol: remove obsolete kmemcg pinning tricks
As charges now pin the css explicitely, there is no more need for kmemcg to acquire a proxy reference for outstanding pages during offlining, or maintain state to identify such "dead" groups. This was the last user of the uncharge functions' return values, so remove them as well. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Vladimir Davydov <vdavydov@parallels.com> Acked-by: Michal Hocko <mhocko@suse.cz> Cc: David Rientjes <rientjes@google.com> Cc: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_counter.c')
-rw-r--r--mm/page_counter.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/mm/page_counter.c b/mm/page_counter.c
index f0cbc08..a009574 100644
--- a/mm/page_counter.c
+++ b/mm/page_counter.c
@@ -16,19 +16,14 @@
* page_counter_cancel - take pages out of the local counter
* @counter: counter
* @nr_pages: number of pages to cancel
- *
- * Returns whether there are remaining pages in the counter.
*/
-int page_counter_cancel(struct page_counter *counter, unsigned long nr_pages)
+void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages)
{
long new;
new = atomic_long_sub_return(nr_pages, &counter->count);
-
/* More uncharges than charges? */
WARN_ON_ONCE(new < 0);
-
- return new > 0;
}
/**
@@ -117,23 +112,13 @@ failed:
* page_counter_uncharge - hierarchically uncharge pages
* @counter: counter
* @nr_pages: number of pages to uncharge
- *
- * Returns whether there are remaining charges in @counter.
*/
-int page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages)
+void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages)
{
struct page_counter *c;
- int ret = 1;
- for (c = counter; c; c = c->parent) {
- int remainder;
-
- remainder = page_counter_cancel(c, nr_pages);
- if (c == counter && !remainder)
- ret = 0;
- }
-
- return ret;
+ for (c = counter; c; c = c->parent)
+ page_counter_cancel(c, nr_pages);
}
/**
OpenPOWER on IntegriCloud