[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.133.4.4 and 1.149

version 1.133.4.4, 2008/02/18 21:06:47 version 1.149, 2008/02/02 20:21:55
Line 122  struct pool_item_header {
Line 122  struct pool_item_header {
         SPLAY_ENTRY(pool_item_header)          SPLAY_ENTRY(pool_item_header)
                                 ph_node;        /* Off-page page headers */                                  ph_node;        /* Off-page page headers */
         void *                  ph_page;        /* this page's address */          void *                  ph_page;        /* this page's address */
         uint32_t                ph_time;        /* last referenced */          struct timeval          ph_time;        /* last referenced */
         uint16_t                ph_nmissing;    /* # of chunks in use */          uint16_t                ph_nmissing;    /* # of chunks in use */
         uint16_t                ph_off;         /* start offset in page */          uint16_t                ph_off;         /* start offset in page */
         union {          union {
Line 1300  pool_do_put(struct pool *pp, void *v, st
Line 1300  pool_do_put(struct pool *pp, void *v, st
                          * be idle for some period of time before it can                           * be idle for some period of time before it can
                          * be reclaimed by the pagedaemon.  This minimizes                           * be reclaimed by the pagedaemon.  This minimizes
                          * ping-pong'ing for memory.                           * ping-pong'ing for memory.
                          *  
                          * note for 64-bit time_t: truncating to 32-bit is not  
                          * a problem for our usage.  
                          */                           */
                         ph->ph_time = time_uptime;                          getmicrotime(&ph->ph_time);
                 }                  }
                 pool_update_curpage(pp);                  pool_update_curpage(pp);
         }          }
Line 1445  pool_prime_page(struct pool *pp, void *s
Line 1442  pool_prime_page(struct pool *pp, void *s
   
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
         if ((pp->pr_roflags & PR_NOALIGN) == 0 &&          if ((pp->pr_roflags & PR_NOALIGN) == 0 &&
             ((uintptr_t)cp & (pp->pr_alloc->pa_pagesz - 1)) != 0)              ((uintptr_t)cp & (align - 1)) != 0)
                 panic("pool_prime_page: %s: unaligned page", pp->pr_wchan);                  panic("pool_prime_page: %s: unaligned page", pp->pr_wchan);
 #endif  #endif
   
Line 1456  pool_prime_page(struct pool *pp, void *s
Line 1453  pool_prime_page(struct pool *pp, void *s
         LIST_INIT(&ph->ph_itemlist);          LIST_INIT(&ph->ph_itemlist);
         ph->ph_page = storage;          ph->ph_page = storage;
         ph->ph_nmissing = 0;          ph->ph_nmissing = 0;
         ph->ph_time = time_uptime;          getmicrotime(&ph->ph_time);
         if ((pp->pr_roflags & PR_PHINPAGE) == 0)          if ((pp->pr_roflags & PR_PHINPAGE) == 0)
                 SPLAY_INSERT(phtree, &pp->pr_phtree, ph);                  SPLAY_INSERT(phtree, &pp->pr_phtree, ph);
   
Line 1617  pool_reclaim(struct pool *pp)
Line 1614  pool_reclaim(struct pool *pp)
 {  {
         struct pool_item_header *ph, *phnext;          struct pool_item_header *ph, *phnext;
         struct pool_pagelist pq;          struct pool_pagelist pq;
         uint32_t curtime;          struct timeval curtime, diff;
         bool klock;          bool klock;
         int rv;          int rv;
   
Line 1654  pool_reclaim(struct pool *pp)
Line 1651  pool_reclaim(struct pool *pp)
   
         LIST_INIT(&pq);          LIST_INIT(&pq);
   
         curtime = time_uptime;          getmicrotime(&curtime);
   
         for (ph = LIST_FIRST(&pp->pr_emptypages); ph != NULL; ph = phnext) {          for (ph = LIST_FIRST(&pp->pr_emptypages); ph != NULL; ph = phnext) {
                 phnext = LIST_NEXT(ph, ph_pagelist);                  phnext = LIST_NEXT(ph, ph_pagelist);
Line 1664  pool_reclaim(struct pool *pp)
Line 1661  pool_reclaim(struct pool *pp)
                         break;                          break;
   
                 KASSERT(ph->ph_nmissing == 0);                  KASSERT(ph->ph_nmissing == 0);
                 if (curtime - ph->ph_time < pool_inactive_time                  timersub(&curtime, &ph->ph_time, &diff);
                   if (diff.tv_sec < pool_inactive_time
                     && !pa_starved_p(pp->pr_alloc))                      && !pa_starved_p(pp->pr_alloc))
                         continue;                          continue;
   
Line 1805  pool_print_pagelist(struct pool *pp, str
Line 1803  pool_print_pagelist(struct pool *pp, str
 #endif  #endif
   
         LIST_FOREACH(ph, pl, ph_pagelist) {          LIST_FOREACH(ph, pl, ph_pagelist) {
                 (*pr)("\t\tpage %p, nmissing %d, time %" PRIu32 "\n",                  (*pr)("\t\tpage %p, nmissing %d, time %lu,%lu\n",
                     ph->ph_page, ph->ph_nmissing, ph->ph_time);                      ph->ph_page, ph->ph_nmissing,
                       (u_long)ph->ph_time.tv_sec,
                       (u_long)ph->ph_time.tv_usec);
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
                 if (!(pp->pr_roflags & PR_NOTOUCH)) {                  if (!(pp->pr_roflags & PR_NOTOUCH)) {
                         LIST_FOREACH(pi, &ph->ph_itemlist, pi_list) {                          LIST_FOREACH(pi, &ph->ph_itemlist, pi_list) {

Legend:
Removed from v.1.133.4.4  
changed lines
  Added in v.1.149

CVSweb <webmaster@jp.NetBSD.org>