[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87sje72bab.fsf@skywalker.in.ibm.com>
Date: Fri, 08 Jun 2012 00:35:00 +0530
From: "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
To: Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: linux-mm@...ck.org, dhillf@...il.com, rientjes@...gle.com,
mhocko@...e.cz, akpm@...ux-foundation.org, hannes@...xchg.org,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [PATCH -V7 07/14] mm/page_cgroup: Make page_cgroup point to the cgroup rather than the mem_cgroup
Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com> writes:
> You can use other pages than head/tails.
> For example,I think you have 512 pages per 2M pages.
How about the below. This limit the usage to hugetlb cgroup to only
hugepages with more than 3 normal pages. I guess that is an acceptable limitation.
static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
{
if (!PageHuge(page))
return NULL;
if (compound_order(page) < 3)
return NULL;
return (struct hugetlb_cgroup *)page[2].lru.next;
}
static inline
int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg)
{
if (!PageHuge(page))
return -1;
if (compound_order(page) < 3)
return -1;
page[2].lru.next = (void *)h_cg;
return 0;
}
-aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists