[BUG][Linux] VM2.8 port eats processor cycles

Stephan Rudlof sr at evolgo.de
Wed Jun 28 23:07:31 UTC 2000


There is a bug somewhere. Possibly I have found the origin, see below.


The new VM2.8 for Linux (Tims port) eats almost all of the processor
cycles; typical values for a running VM2.8 Squeak *without* any
computations are:
 3189 sr        16   0 25236  24M  3832 R       0 99.0 15.8   1:04
squeak "VM2.8"
and:
 3186 sr        19   0 25208  24M  3844 R       0  8.1 15.8   0:16
_orig_squeak "VM2.7"
for the VM2.7, both with same image #2345.

Is anybody able to confirm this observation?

Where could this processor cycles diminish?
How to dig in deeper?

Morphic:

Pressing Alt-. leads to 

MorphicEvent class>>new
HandMorph>>processEvents
[] in PasteUpMorph>>doOneCycleNow
Array(SequenceableCollection)>>do:
PasteUpMorph>>handsDo:
PasteUpMorph>>doOneCycleNow
PasteUpMorph>>doOneCycle
[] in Project>>spawnNewProcess
[] in BlockContext>>newProcess

in the debugger.

Increasing PasteUpMorph>>MinCycleLapse doesn't change the situation.

Digging deeper:

The idle process calls
ProcessorScheduler>>relinquishProcessorForMicroseconds:, which itself
leads to a call of

sqXWindow.c line 1517/3563:

int ioRelinquishProcessorForMicroseconds(int microSeconds)
{
  /* sleep in select() for immediate response to socket i/o */
#ifdef HEADLESS
  if ( socketPollFunction ) { socketPollFunction(microSeconds,0);}
  /* aioPollForIO(microSeconds, 0); */
#else
  if ( socketPollFunction ) { socketPollFunction(microSeconds,stXfd);}
  /* aioPollForIO(microSeconds, stXfd); */
#endif
        return microSeconds;
}

There is a socketPollFunction, which has to be set by
setSocketPollFunction( int spf), because it is initialized to 0;
grep'ing for setSocketPollFunction() reveals:

sr at Klaus:~/Squeak/2.8/src > grep setSocketPollFunction *.c *.h
../interp.c 
sqXWindow.c:void setSocketPollFunction( int spf) {

. It won't be called! So ioRelinquishProcessorForMicroseconds() returns
*very* fast and the idle process doesn't give processor cycles to the
OS.

If these thoughts are correct, then I have found the bug!


Stephan
-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list