Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6
* 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6: (34 commits) HWPOISON: Remove stray phrase in a comment HWPOISON: Try to allocate migration page on the same node HWPOISON: Don't do early filtering if filter is disabled HWPOISON: Add a madvise() injector for soft page offlining HWPOISON: Add soft page offline support HWPOISON: Undefine short-hand macros after use to avoid namespace conflict HWPOISON: Use new shake_page in memory_failure HWPOISON: Use correct name for MADV_HWPOISON in documentation HWPOISON: mention HWPoison in Kconfig entry HWPOISON: Use get_user_page_fast in hwpoison madvise HWPOISON: add an interface to switch off/on all the page filters HWPOISON: add memory cgroup filter memcg: add accessor to mem_cgroup.css memcg: rename and export try_get_mem_cgroup_from_page() HWPOISON: add page flags filter mm: export stable page flags HWPOISON: limit hwpoison injector to known page types HWPOISON: add fs/device filters HWPOISON: return 0 to indicate success reliably HWPOISON: make semantics of IGNORED/DELAYED clear ...
This commit is contained in:
@@ -283,6 +283,11 @@ mem_cgroup_zoneinfo(struct mem_cgroup *mem, int nid, int zid)
|
||||
return &mem->info.nodeinfo[nid]->zoneinfo[zid];
|
||||
}
|
||||
|
||||
struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem)
|
||||
{
|
||||
return &mem->css;
|
||||
}
|
||||
|
||||
static struct mem_cgroup_per_zone *
|
||||
page_cgroup_zoneinfo(struct page_cgroup *pc)
|
||||
{
|
||||
@@ -1536,25 +1541,22 @@ static struct mem_cgroup *mem_cgroup_lookup(unsigned short id)
|
||||
return container_of(css, struct mem_cgroup, css);
|
||||
}
|
||||
|
||||
static struct mem_cgroup *try_get_mem_cgroup_from_swapcache(struct page *page)
|
||||
struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page)
|
||||
{
|
||||
struct mem_cgroup *mem;
|
||||
struct mem_cgroup *mem = NULL;
|
||||
struct page_cgroup *pc;
|
||||
unsigned short id;
|
||||
swp_entry_t ent;
|
||||
|
||||
VM_BUG_ON(!PageLocked(page));
|
||||
|
||||
if (!PageSwapCache(page))
|
||||
return NULL;
|
||||
|
||||
pc = lookup_page_cgroup(page);
|
||||
lock_page_cgroup(pc);
|
||||
if (PageCgroupUsed(pc)) {
|
||||
mem = pc->mem_cgroup;
|
||||
if (mem && !css_tryget(&mem->css))
|
||||
mem = NULL;
|
||||
} else {
|
||||
} else if (PageSwapCache(page)) {
|
||||
ent.val = page_private(page);
|
||||
id = lookup_swap_cgroup(ent);
|
||||
rcu_read_lock();
|
||||
@@ -1874,7 +1876,7 @@ int mem_cgroup_try_charge_swapin(struct mm_struct *mm,
|
||||
*/
|
||||
if (!PageSwapCache(page))
|
||||
goto charge_cur_mm;
|
||||
mem = try_get_mem_cgroup_from_swapcache(page);
|
||||
mem = try_get_mem_cgroup_from_page(page);
|
||||
if (!mem)
|
||||
goto charge_cur_mm;
|
||||
*ptr = mem;
|
||||
|
Reference in New Issue
Block a user