diff options
author | Mark Brown <broonie@linaro.org> | 2013-07-19 10:30:43 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-19 10:30:43 +0100 |
commit | 0a37d59e3c8c2299f8931df0cb1c0f525047fab5 (patch) | |
tree | 932ce8b019e13274910111b9b944f050d3d36c63 /mm | |
parent | 9bca3d7f7c5865700303e8bce0eac57bab76bcc7 (diff) | |
parent | cb5d8be972cfbea114ea56fd63ed5ce1644863df (diff) |
Merge tag 'v3.10.1' into linux-linaro-lsk
This is the 3.10.1 stable release
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb.c | 17 | ||||
-rw-r--r-- | mm/memcontrol.c | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e2bfbf73a551..5cf99bf8cce2 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -690,6 +690,23 @@ int PageHuge(struct page *page) } EXPORT_SYMBOL_GPL(PageHuge); +pgoff_t __basepage_index(struct page *page) +{ + struct page *page_head = compound_head(page); + pgoff_t index = page_index(page_head); + unsigned long compound_idx; + + if (!PageHuge(page_head)) + return page_index(page); + + if (compound_order(page_head) >= MAX_ORDER) + compound_idx = page_to_pfn(page) - page_to_pfn(page_head); + else + compound_idx = page - page_head; + + return (index << compound_order(page_head)) + compound_idx; +} + static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid) { struct page *page; diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 194721839cf5..fd79df5d3152 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6303,8 +6303,6 @@ mem_cgroup_css_online(struct cgroup *cont) * call __mem_cgroup_free, so return directly */ mem_cgroup_put(memcg); - if (parent->use_hierarchy) - mem_cgroup_put(parent); } return error; } |