Date: Sun, 21 Mar 2004 16:28:38 -0800 (PST) From: Bill Paul <wpaul@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/i386/i386 vm_machdep.c Message-ID: <200403220028.i2M0ScPc047763@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
wpaul 2004/03/21 16:28:38 PST FreeBSD src repository Modified files: sys/i386/i386 vm_machdep.c Log: The kthread_create() API is supposed to allow you to create threads with more than the normal amount of stack pages, however the stack pointer always wound up being initialized using KSTACK_PAGES. It should be using td->td_kstack_pages instead. This means that although the vm subsystem would give you all the stack pages you asked for, %esp would always be initialized as if you had just 2 pages, and the rest would go to waste. I wanted to use the 'give me more stack pages' feature of kthread_create() because the Intel 2200BG NDIS driver does an alloca() of about 5000 bytes, which wrecks the stack with the default 2 page size, and I was baffled that no matter how much code I shoved into thread contexts with allegedly larger stacks, the thing would still crash unless I changed KSTACK_PAGES. Note: this bug is present in _ALL_ arches at this point. Peter has promised to merge this fix into all of them. Revision Changes Path 1.233 +4 -3 src/sys/i386/i386/vm_machdep.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403220028.i2M0ScPc047763>