瀏覽代碼

slub page alloc fallback: Enable interrupts for GFP_WAIT.

The fallback path needs to enable interrupts like done for
the other page allocator calls. This was not necessary with
the alternate fast path since we handled irq enable/disable in
the slow path. The regular fastpath handles irq enable/disable
around calls to the slow path so we need to restore the proper
status before calling the page allocator from the slowpath.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Christoph Lameter 17 年之前
父節點
當前提交
caeab084de
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      mm/slub.c

+ 9 - 3
mm/slub.c

@@ -1536,9 +1536,15 @@ new_slab:
 	 * That is only possible if certain conditions are met that are being
 	 * That is only possible if certain conditions are met that are being
 	 * checked when a slab is created.
 	 * checked when a slab is created.
 	 */
 	 */
-	if (!(gfpflags & __GFP_NORETRY) && (s->flags & __PAGE_ALLOC_FALLBACK))
-		return kmalloc_large(s->objsize, gfpflags);
-
+	if (!(gfpflags & __GFP_NORETRY) &&
+				(s->flags & __PAGE_ALLOC_FALLBACK)) {
+		if (gfpflags & __GFP_WAIT)
+			local_irq_enable();
+		object = kmalloc_large(s->objsize, gfpflags);
+		if (gfpflags & __GFP_WAIT)
+			local_irq_disable();
+		return object;
+	}
 	return NULL;
 	return NULL;
 debug:
 debug:
 	if (!alloc_debug_processing(s, c->page, object, addr))
 	if (!alloc_debug_processing(s, c->page, object, addr))