aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-06-05 00:34:22 -0400
committerDave Airlie <airlied@redhat.com>2013-06-05 00:34:22 -0400
commit943079e111bde93ed972d21618d1d73e75ba0d09 (patch)
tree32626f38001c6fd69340fe44a296ae34760872fa /mm/memcontrol.c
parentec7fdeee19474afb2169bb0939cbc972f9aa20eb (diff)
parent53d3b4d7778daf15900867336c85d3f8dd70600c (diff)
Merge tag 'drm-intel-fixes-2013-06-04' of git://people.freedesktop.org/~danvet/drm-intel into drm-fixes
Daniel writes: Three regression fixes and one no-lvds quirk update. The regression Egbert Eich tracked down goes back to 2.6.37 ... ugh. The other two are pretty minor: One bogus modeset state checker WARN and a patch to prevent X dying in a SIGBUS after a gpu hang with failed (or not implement as on gen2/3) gpu reset. * tag 'drm-intel-fixes-2013-06-04' of git://people.freedesktop.org/~danvet/drm-intel: (368 commits) drm/i915/sdvo: Use &intel_sdvo->ddc instead of intel_sdvo->i2c for DDC. drm/i915: no lvds quirk for hp t5740 drm/i915: Quirk the pipe A quirk in the modeset state checker drm/i915: Fix spurious -EIO/SIGBUS on wedged gpus Linux 3.10-rc4 parisc: parport0: fix this legacy no-device port driver! parport_pc: disable PARPORT_PC_SUPERIO on parisc architecture parisc/PCI: lba: fix: convert to pci_create_root_bus() for correct root bus resources (v2) parisc/PCI: Set type for LBA bus_num resource MAINTAINERS: update parisc architecture file list parisc: kernel: using strlcpy() instead of strcpy() parisc: rename "CONFIG_PA7100" to "CONFIG_PA7000" parisc: fix kernel BUG at arch/parisc/include/asm/mmzone.h:50 parisc: memory overflow, 'name' length is too short for using powerpc/cputable: Fix typo on P7+ cputable entry powerpc/perf: Add missing SIER support powerpc/perf: Revert to original NO_SIPR logic powerpc/pci: Remove the unused variables in pci_process_bridge_OF_ranges powerpc/pci: Remove the stale comments of pci_process_bridge_OF_ranges powerpc/pseries: Always enable CONFIG_HOTPLUG_CPU on PSERIES SMP ...
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index cb1c9dedf9b6..010d6c14129a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4108,8 +4108,6 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype,
4108 if (mem_cgroup_disabled()) 4108 if (mem_cgroup_disabled())
4109 return NULL; 4109 return NULL;
4110 4110
4111 VM_BUG_ON(PageSwapCache(page));
4112
4113 if (PageTransHuge(page)) { 4111 if (PageTransHuge(page)) {
4114 nr_pages <<= compound_order(page); 4112 nr_pages <<= compound_order(page);
4115 VM_BUG_ON(!PageTransHuge(page)); 4113 VM_BUG_ON(!PageTransHuge(page));
@@ -4205,6 +4203,18 @@ void mem_cgroup_uncharge_page(struct page *page)
4205 if (page_mapped(page)) 4203 if (page_mapped(page))
4206 return; 4204 return;
4207 VM_BUG_ON(page->mapping && !PageAnon(page)); 4205 VM_BUG_ON(page->mapping && !PageAnon(page));
4206 /*
4207 * If the page is in swap cache, uncharge should be deferred
4208 * to the swap path, which also properly accounts swap usage
4209 * and handles memcg lifetime.
4210 *
4211 * Note that this check is not stable and reclaim may add the
4212 * page to swap cache at any time after this. However, if the
4213 * page is not in swap cache by the time page->mapcount hits
4214 * 0, there won't be any page table references to the swap
4215 * slot, and reclaim will free it and not actually write the
4216 * page to disk.
4217 */
4208 if (PageSwapCache(page)) 4218 if (PageSwapCache(page))
4209 return; 4219 return;
4210 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_ANON, false); 4220 __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_ANON, false);