From 7c89190b50adbd3cd83ee201d8587d0474ea1f63 Mon Sep 17 00:00:00 2001 From: ad Date: Mon, 15 Dec 2008 11:59:22 +0000 Subject: [PATCH] Start percpu allocation at (ALIGNBYTES + 1) to avoid problem with importing offset zero to vmem. --- sys/kern/subr_percpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/subr_percpu.c b/sys/kern/subr_percpu.c index a5f294d9c9c0..cfae75985b41 100644 --- a/sys/kern/subr_percpu.c +++ b/sys/kern/subr_percpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_percpu.c,v 1.8 2008/05/03 05:31:56 yamt Exp $ */ +/* $NetBSD: subr_percpu.c,v 1.9 2008/12/15 11:59:22 ad Exp $ */ /*- * Copyright (c)2007,2008 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.8 2008/05/03 05:31:56 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.9 2008/12/15 11:59:22 ad Exp $"); #include #include @@ -45,11 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.8 2008/05/03 05:31:56 yamt Exp $") #include -static krwlock_t percpu_swap_lock; -static kmutex_t percpu_allocation_lock; -static vmem_t *percpu_offset_arena; -static unsigned int percpu_nextoff; - #define PERCPU_QUANTUM_SIZE (ALIGNBYTES + 1) #define PERCPU_QCACHE_MAX 0 #define PERCPU_IMPORT_SIZE 2048 @@ -63,6 +58,11 @@ static unsigned int percpu_nextoff; #define percpu_decrypt(pc) (pc) #endif /* defined(DIAGNOSTIC) */ +static krwlock_t percpu_swap_lock; +static kmutex_t percpu_allocation_lock; +static vmem_t *percpu_offset_arena; +static unsigned int percpu_nextoff = PERCPU_QUANTUM_SIZE; + static percpu_cpu_t * cpu_percpu(struct cpu_info *ci) {