Start percpu allocation at (ALIGNBYTES + 1) to avoid problem with importing

offset zero to vmem.
This commit is contained in:
ad 2008-12-15 11:59:22 +00:00
parent c1ef49a66f
commit 7c89190b50
1 changed files with 7 additions and 7 deletions

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/cpu.h>
@ -45,11 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: subr_percpu.c,v 1.8 2008/05/03 05:31:56 yamt Exp $")
#include <uvm/uvm_extern.h>
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)
{