Index: kernel/generic/src/mm/reserve.c
===================================================================
--- kernel/generic/src/mm/reserve.c	(revision 864b0dd5fb43be2d8525221d1186f5f58d58a484)
+++ kernel/generic/src/mm/reserve.c	(revision 74c8f34494162616317c01dd0cbff697b306111a)
@@ -38,4 +38,5 @@
 #include <mm/reserve.h>
 #include <mm/frame.h>
+#include <mm/slab.h>
 #include <synch/spinlock.h>
 #include <typedefs.h>
@@ -45,4 +46,12 @@
 static ssize_t reserve = 0;
 
+/** Try to reserve memory.
+ *
+ * This function may not be called from contexts that do not allow memory
+ * reclaiming, such as some invocations of frame_alloc_generic().
+ *
+ * @param size		Number of frames to reserve.
+ * @return		True on success or false otherwise.
+ */
 bool reserve_try_alloc(size_t size)
 {
@@ -53,4 +62,26 @@
 		reserve -= size;
 		reserved = true;
+	} else {
+		/*
+		 * Some reservable frames may be cached by the slab allocator.
+		 * Try to reclaim some reservable memory. Try to be gentle for
+		 * the first time. If it does not help, try to reclaim
+		 * everything.
+		 */
+		irq_spinlock_unlock(&reserve_lock, true);
+		slab_reclaim(0);
+		irq_spinlock_lock(&reserve_lock, true);
+		if (reserve >= 0 && (size_t) reserve >= size) {
+			reserve -= size;
+			reserved = true;
+		} else {
+			irq_spinlock_unlock(&reserve_lock, true);
+			slab_reclaim(SLAB_RECLAIM_ALL);
+			irq_spinlock_lock(&reserve_lock, true);
+			if (reserve >= 0 && (size_t) reserve >= size) {
+				reserve -= size;
+				reserved = true;
+			}
+		}
 	}
 	irq_spinlock_unlock(&reserve_lock, true);
@@ -59,4 +90,13 @@
 }
 
+/** Reserve memory.
+ *
+ * This function simply marks the respective amount of memory frames reserved.
+ * It does not implement any sort of blocking for the case there is not enough
+ * reservable memory. It will simply take the reserve into negative numbers and
+ * leave the blocking up to the allocation phase.
+ *
+ * @param size		Number of frames to reserve.
+ */
 void reserve_force_alloc(size_t size)
 {
@@ -66,4 +106,8 @@
 }
 
+/** Unreserve memory.
+ *
+ * @param size		Number of frames to unreserve.
+ */
 void reserve_free(size_t size)
 {
