svn commit: r286223 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Steven Hartland steven at multiplay.co.uk
Mon Aug 3 13:49:23 UTC 2015



On 03/08/2015 13:03, Konstantin Belousov wrote:
> On Mon, Aug 03, 2015 at 12:50:19PM +0100, Steven Hartland wrote:
>> For this change I don't want to get into fixing the thread0 stack size,
>> which can be done later, just
>> to provide a reasonable warning to the user that smaller values could
>> cause a panic.
> Hmm, is it limited to the thread0 only ?  I.e., would only increasing
> the initial thread stack size be enough to boot the kernel ?  The zfs
> threads do request larger stack size, I know this.
>
> Can somebody test the following patch in the i386 configuration which
> does not boot ?
>
> diff --git a/sys/i386/i386/genassym.c b/sys/i386/i386/genassym.c
> index 7a00740..6a00d23 100644
> --- a/sys/i386/i386/genassym.c
> +++ b/sys/i386/i386/genassym.c
> @@ -103,6 +103,7 @@ ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall));
>   ASSYM(V_INTR, offsetof(struct vmmeter, v_intr));
>   /* ASSYM(UPAGES, UPAGES);*/
>   ASSYM(KSTACK_PAGES, KSTACK_PAGES);
> +ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES);
>   ASSYM(PAGE_SIZE, PAGE_SIZE);
>   ASSYM(NPTEPG, NPTEPG);
>   ASSYM(NPDEPG, NPDEPG);
> diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s
> index 5bf7944..4d8e22f 100644
> --- a/sys/i386/i386/locore.s
> +++ b/sys/i386/i386/locore.s
> @@ -731,7 +731,7 @@ no_kernend:
>   	movl	%esi,R(IdlePTD)
>   
>   /* Allocate KSTACK */
> -	ALLOCPAGES(KSTACK_PAGES)
> +	ALLOCPAGES(TD0_KSTACK_PAGES)
>   	movl	%esi,R(p0kpa)
>   	addl	$KERNBASE, %esi
>   	movl	%esi, R(proc0kstack)
> @@ -800,7 +800,7 @@ no_kernend:
>   
>   /* Map proc0's KSTACK in the physical way ... */
>   	movl	R(p0kpa), %eax
> -	movl	$(KSTACK_PAGES), %ecx
> +	movl	$(TD0_KSTACK_PAGES), %ecx
>   	fillkptphys($PG_RW)
>   
>   /* Map ISA hole */
> diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
> index 2be5dbc..76790f0 100644
> --- a/sys/i386/i386/machdep.c
> +++ b/sys/i386/i386/machdep.c
> @@ -2445,7 +2445,7 @@ init386(first)
>   #endif
>   
>   	thread0.td_kstack = proc0kstack;
> -	thread0.td_kstack_pages = KSTACK_PAGES;
> +	thread0.td_kstack_pages = TD0_KSTACK_PAGES;
>   
>   	/*
>    	 * This may be done better later if it gets more high level
> diff --git a/sys/i386/include/param.h b/sys/i386/include/param.h
> index b3fd85f..bc79c20 100644
> --- a/sys/i386/include/param.h
> +++ b/sys/i386/include/param.h
> @@ -114,6 +114,11 @@
>   #define KSTACK_PAGES 2		/* Includes pcb! */
>   #endif
>   #define KSTACK_GUARD_PAGES 1	/* pages of kstack guard; 0 disables */
> +#if KSTACK_PAGES < 3
> +#define	TD0_KSTACK_PAGES 4
> +#else
> +#define	TD0_KSTACK_PAGES KSTACK_PAGES
> +#endif
>   
>   /*
>    * Ceiling on amount of swblock kva space, can be changed via
I don't have a reproduction box here I'm afraid, might be an idea to 
post the patch to the following bug reports to see if one of the 
reporters can test:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201859
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189355

     Regards
     Steve


More information about the svn-src-all mailing list