cvs commit: src/sys/i386/i386 vm_machdep.c

Bill Paul wpaul at FreeBSD.org
Sun Mar 21 16:28:39 PST 2004


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


More information about the cvs-src mailing list