From 93b4c5b70716e571ffc7b2a1cf8028bfe1ec319e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 30 Jul 2003 18:55:04 +0000 Subject: [PATCH] The introduction of vm object locking has caused witness to reveal a long-standing mistake in the way a portion of a pipe's KVA is allocated. Specifically, kmem_alloc_pageable() is inappropriate for use in the "direct" case because it allows a preceding vm map entry and vm object to be extended to support the new KVA allocation. However, the direct case KVA allocation should not have a backing vm object. This is corrected by using kmem_alloc_nofault(). Submitted by: tegge (with the above explanation by me) --- sys/kern/sys_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 0b1b69d1799b..8ced29f4fcb9 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -732,7 +732,7 @@ pipe_build_write_buffer(wpipe, uio) * We need to allocate space for an extra page because the * address range might (will) span pages at times. */ - wpipe->pipe_map.kva = kmem_alloc_pageable(kernel_map, + wpipe->pipe_map.kva = kmem_alloc_nofault(kernel_map, wpipe->pipe_buffer.size + PAGE_SIZE); atomic_add_int(&amountpipekva, wpipe->pipe_buffer.size + PAGE_SIZE);