>  The following command line switch (-n) adds an initial hack to 
>  conf.nproc to override the 2000 hard coded limit.  While this allws me 
>  to now run over 64 threads, running it to high gives me a warning that 
>  there are to many procs for devproc.  I'm providing the patch here as 

this is a bug in the warning message.

; diffy -c devproc.c
/n/dump/2011/0526/sys/src/9/port/devproc.c:139,147 - devproc.c:139,149
   * If notepg, c->pgrpid.path is pgrp slot, .vers is noteid.
   */
  #define       QSHIFT  5       /* location in qid of proc slot # */
+ #define       SLOTBITS 23     /* number of bits in the slot */
+ #define       SLOTMASK        ((1<<SLOTBITS)-1 << QSHIFT)
  
  #define       QID(q)          ((((ulong)(q).path)&0x0000001F)>>0)
- #define       SLOT(q)         (((((ulong)(q).path)&0x07FFFFFE0)>>QSHIFT)-1)
+ #define       SLOT(q)         (((((ulong)(q).path)&SLOTMASK)>>QSHIFT)-1)
  #define       PID(q)          ((q).vers)
  #define       NOTEID(q)       ((q).vers)
  
/n/dump/2011/0526/sys/src/9/port/devproc.c:288,294 - devproc.c:290,296
  static void
  procinit(void)
  {
-       if(conf.nproc >= (1<<(16-QSHIFT))-1)
+       if(conf.nproc >= (SLOTMASK>>QSHIFT) - 1)
                print("warning: too many procs for devproc\n");
        addclock0link((void (*)(void))profclock, 113);  /* Relative prime to HZ 
*/
  }

- erik

Reply via email to