diff options
author | pjd <pjd@FreeBSD.org> | 2007-08-16 20:33:20 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-08-16 20:33:20 +0000 |
commit | 65eefb41d211ef4758586a57635d01fc532f9c8b (patch) | |
tree | 0199b6d72b0d8a2905360330e2781572b7823618 /sys | |
parent | e83de305a6e6423afe873de281186f0d4e9ee0c5 (diff) | |
download | FreeBSD-src-65eefb41d211ef4758586a57635d01fc532f9c8b.zip FreeBSD-src-65eefb41d211ef4758586a57635d01fc532f9c8b.tar.gz |
Some ZFS threads needs stack larger than the default 8kB, so use 16kB of
alternate stack if the default is smaller than 16kB.
Approved by: re (rwatson)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/proc.h | 9 | ||||
-rw-r--r-- | sys/compat/opensolaris/sys/proc.h | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/proc.h b/sys/cddl/compat/opensolaris/sys/proc.h index 10e4442..2532c57 100644 --- a/sys/cddl/compat/opensolaris/sys/proc.h +++ b/sys/cddl/compat/opensolaris/sys/proc.h @@ -56,6 +56,12 @@ typedef struct thread kthread_t; typedef struct thread *kthread_id_t; typedef struct proc proc_t; +#if (KSTACK_PAGES * PAGE_SIZE) < 16384 +#define ZFS_KSTACK_PAGES (16384 / PAGE_SIZE) +#else +#define ZFS_KSTACK_PAGES 0 +#endif + static __inline kthread_t * thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri) @@ -71,7 +77,8 @@ thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, ASSERT(len == 0); ASSERT(state == TS_RUN); - error = kthread_create(proc, arg, &p, 0, 0, "solthread %p", proc); + error = kthread_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES, + "solthread %p", proc); return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL); } diff --git a/sys/compat/opensolaris/sys/proc.h b/sys/compat/opensolaris/sys/proc.h index 10e4442..2532c57 100644 --- a/sys/compat/opensolaris/sys/proc.h +++ b/sys/compat/opensolaris/sys/proc.h @@ -56,6 +56,12 @@ typedef struct thread kthread_t; typedef struct thread *kthread_id_t; typedef struct proc proc_t; +#if (KSTACK_PAGES * PAGE_SIZE) < 16384 +#define ZFS_KSTACK_PAGES (16384 / PAGE_SIZE) +#else +#define ZFS_KSTACK_PAGES 0 +#endif + static __inline kthread_t * thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri) @@ -71,7 +77,8 @@ thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, ASSERT(len == 0); ASSERT(state == TS_RUN); - error = kthread_create(proc, arg, &p, 0, 0, "solthread %p", proc); + error = kthread_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES, + "solthread %p", proc); return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL); } |