[BACK]Return to subr_pool.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / kern

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/kern/subr_pool.c between version 1.30.2.2 and 1.35

version 1.30.2.2, 2000/11/22 16:05:24 version 1.35, 2000/05/31 15:03:54
Line 51 
Line 51 
 #include <sys/pool.h>  #include <sys/pool.h>
 #include <sys/syslog.h>  #include <sys/syslog.h>
   
   #include <vm/vm.h>
   #include <vm/vm_kern.h>
   
 #include <uvm/uvm.h>  #include <uvm/uvm.h>
   
 /*  /*
Line 401  pool_init(pp, size, align, ioff, flags, 
Line 404  pool_init(pp, size, align, ioff, flags, 
         /*          /*
          * Check arguments and construct default values.           * Check arguments and construct default values.
          */           */
         if (!powerof2(pagesz))          if (!powerof2(pagesz) || pagesz > PAGE_SIZE)
                 panic("pool_init: page size invalid (%lx)\n", (u_long)pagesz);                  panic("pool_init: page size invalid (%lx)\n", (u_long)pagesz);
   
         if (alloc == NULL && release == NULL) {          if (alloc == NULL && release == NULL) {
Line 591  _pool_get(pp, flags, file, line)
Line 594  _pool_get(pp, flags, file, line)
         }          }
 #endif  #endif
   
         if (__predict_false(curproc == NULL && doing_shutdown == 0 &&          if (__predict_false(curproc == NULL && (flags & PR_WAITOK) != 0))
                             (flags & PR_WAITOK) != 0))  
                 panic("pool_get: must have NOWAIT");                  panic("pool_get: must have NOWAIT");
   
         simple_lock(&pp->pr_slock);          simple_lock(&pp->pr_slock);
Line 619  _pool_get(pp, flags, file, line)
Line 621  _pool_get(pp, flags, file, line)
                          */                           */
                         pp->pr_flags |= PR_WANTED;                          pp->pr_flags |= PR_WANTED;
                         pr_leave(pp);                          pr_leave(pp);
                         ltsleep(pp, PSWP, pp->pr_wchan, 0, &pp->pr_slock);                          simple_unlock(&pp->pr_slock);
                           tsleep((caddr_t)pp, PSWP, pp->pr_wchan, 0);
                           simple_lock(&pp->pr_slock);
                         pr_enter(pp, file, line);                          pr_enter(pp, file, line);
                         goto startover;                          goto startover;
                 }                  }
Line 704  _pool_get(pp, flags, file, line)
Line 708  _pool_get(pp, flags, file, line)
                          */                           */
                         pp->pr_flags |= PR_WANTED;                          pp->pr_flags |= PR_WANTED;
                         pr_leave(pp);                          pr_leave(pp);
                         ltsleep(pp, PSWP, pp->pr_wchan, 0, &pp->pr_slock);                          simple_unlock(&pp->pr_slock);
                           tsleep((caddr_t)pp, PSWP, pp->pr_wchan, 0);
                           simple_lock(&pp->pr_slock);
                         pr_enter(pp, file, line);                          pr_enter(pp, file, line);
                         goto startover;                          goto startover;
                 }                  }
Line 1019  pool_prime_page(pp, storage)
Line 1025  pool_prime_page(pp, storage)
         unsigned int ioff = pp->pr_itemoffset;          unsigned int ioff = pp->pr_itemoffset;
         int s, n;          int s, n;
   
         if (((u_long)cp & (pp->pr_pagesz - 1)) != 0)  
                 panic("pool_prime_page: %s: unaligned page", pp->pr_wchan);  
   
         if ((pp->pr_roflags & PR_PHINPAGE) != 0) {          if ((pp->pr_roflags & PR_PHINPAGE) != 0) {
                 ph = (struct pool_item_header *)(cp + pp->pr_phoffset);                  ph = (struct pool_item_header *)(cp + pp->pr_phoffset);
         } else {          } else {
Line 1150  pool_setlowat(pp, n)
Line 1153  pool_setlowat(pp, n)
                 : roundup(n, pp->pr_itemsperpage) / pp->pr_itemsperpage;                  : roundup(n, pp->pr_itemsperpage) / pp->pr_itemsperpage;
   
         /* Make sure we're caught up with the newly-set low water mark. */          /* Make sure we're caught up with the newly-set low water mark. */
         if ((pp->pr_nitems < pp->pr_minitems) &&          if ((error = pool_catchup(pp)) != 0) {
             (error = pool_catchup(pp)) != 0) {  
                 /*                  /*
                  * XXX: Should we log a warning?  Should we set up a timeout                   * XXX: Should we log a warning?  Should we set up a timeout
                  * to try again in a second or so?  The latter could break                   * to try again in a second or so?  The latter could break

Legend:
Removed from v.1.30.2.2  
changed lines
  Added in v.1.35

CVSweb <webmaster@jp.NetBSD.org>