Doug White wrote: >On Wed, 2 Mar 2005, David Xu wrote: > > > >>I believe this is caused by swapped out of kernel thread stack. >>in /sys/vm/vm_glue.c, there is some code swapping out a sleeping process, >>this means any kernel code can not use thread local variable to communicate >>with other threads, this is a rather unsafe assumptions, the vm code really >>should be disabled. >> >> > >I don't quite understand what you mean by "vm code really should be >disabled"; is virtual memory really that bad? :) > >The consensus on IRC is that threads should not use their stacks for >anything but storage of their own variables. Anything used for >synchronization or state should be placed in malloc()d memory or some >other shared structure. > > > Stack variable is cheap and fastest, why should I use slow malloc ? >I'll start working on a patch to change these references in the sigwait() >family. And queue up a pointy hat to jeff_at_. Pointers to other badly >behaved code gladly accepted :) > > This is not a bug, I always perfer to use stack variable because there is no lock order reversal and have to work around it. If I am correct, Linux and DragonFly both disable kernel stack to be swapped out. David XuReceived on Thu Mar 03 2005 - 04:07:37 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:29 UTC