summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-06-17 10:45:28 +0200
committerTakashi Iwai <tiwai@suse.de>2013-06-17 10:45:28 +0200
commitddf753efa4f1f74cb182be6d0a6e41d72a8bf807 (patch)
treea894b94b7e36f338d5879a243d628e346060cb4a /mm/page_alloc.c
parent63e51fd708f511a5989da04c669647993bc1a512 (diff)
parent36691e1be6ec551eef4a5225f126a281f8c051c2 (diff)
downloadop-kernel-dev-ddf753efa4f1f74cb182be6d0a6e41d72a8bf807.zip
op-kernel-dev-ddf753efa4f1f74cb182be6d0a6e41d72a8bf807.tar.gz
Merge branch 'for-linus' into for-next
* for-linus: (635 commits) ALSA: usb-audio: Fix invalid volume resolution for Logitech HD Webcam c310 ALSA: hda - Fix pin configurations for MacBook Air 4,2 ALSA: usb-audio: work around Android accessory firmware bug ALSA: hda - Headset mic support for three more machines Linux 3.10-rc6 smp.h: Use local_irq_{save,restore}() in !SMP version of on_each_cpu(). powerpc: Fix missing/delayed calls to irq_work powerpc: Fix emulation of illegal instructions on PowerNV platform powerpc: Fix stack overflow crash in resume_kernel when ftracing snd_pcm_link(): fix a leak... use can_lookup() instead of direct checks of ->i_op->lookup move exit_task_namespaces() outside of exit_notify() fput: task_work_add() can fail if the caller has passed exit_task_work() xfs: don't shutdown log recovery on validation errors xfs: ensure btree root split sets blkno correctly xfs: fix implicit padding in directory and attr CRC formats xfs: don't emit v5 superblock warnings on write mei: me: clear interrupts on the resume path mei: nfc: fix nfc device freeing mei: init: Flush scheduled work before resetting the device ...
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 378a15b..c3edb62 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1628,6 +1628,7 @@ static bool __zone_watermark_ok(struct zone *z, int order, unsigned long mark,
long min = mark;
long lowmem_reserve = z->lowmem_reserve[classzone_idx];
int o;
+ long free_cma = 0;
free_pages -= (1 << order) - 1;
if (alloc_flags & ALLOC_HIGH)
@@ -1637,9 +1638,10 @@ static bool __zone_watermark_ok(struct zone *z, int order, unsigned long mark,
#ifdef CONFIG_CMA
/* If allocation can't use CMA areas don't use free CMA pages */
if (!(alloc_flags & ALLOC_CMA))
- free_pages -= zone_page_state(z, NR_FREE_CMA_PAGES);
+ free_cma = zone_page_state(z, NR_FREE_CMA_PAGES);
#endif
- if (free_pages <= min + lowmem_reserve)
+
+ if (free_pages - free_cma <= min + lowmem_reserve)
return false;
for (o = 0; o < order; o++) {
/* At the next order, this order's pages become unavailable */
OpenPOWER on IntegriCloud