[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.195 and 1.196

version 1.195, 2012/05/05 19:15:10 version 1.196, 2012/06/05 22:28:11
Line 191  static bool pool_cache_get_slow(pool_cac
Line 191  static bool pool_cache_get_slow(pool_cac
 static void     pool_cache_cpu_init1(struct cpu_info *, pool_cache_t);  static void     pool_cache_cpu_init1(struct cpu_info *, pool_cache_t);
 static void     pool_cache_invalidate_groups(pool_cache_t, pcg_t *);  static void     pool_cache_invalidate_groups(pool_cache_t, pcg_t *);
 static void     pool_cache_invalidate_cpu(pool_cache_t, u_int);  static void     pool_cache_invalidate_cpu(pool_cache_t, u_int);
 static void     pool_cache_xcall(pool_cache_t);  static void     pool_cache_transfer(pool_cache_t);
   
 static int      pool_catchup(struct pool *);  static int      pool_catchup(struct pool *);
 static void     pool_prime_page(struct pool *, void *,  static void     pool_prime_page(struct pool *, void *,
Line 1425  pool_drain_start(struct pool **ppp, uint
Line 1425  pool_drain_start(struct pool **ppp, uint
         /* If there is a pool_cache, drain CPU level caches. */          /* If there is a pool_cache, drain CPU level caches. */
         *ppp = pp;          *ppp = pp;
         if (pp->pr_cache != NULL) {          if (pp->pr_cache != NULL) {
                 *wp = xc_broadcast(0, (xcfunc_t)pool_cache_xcall,                  *wp = xc_broadcast(0, (xcfunc_t)pool_cache_transfer,
                     pp->pr_cache, NULL);                      pp->pr_cache, NULL);
         }          }
 }  }
Line 2007  pool_cache_invalidate_groups(pool_cache_
Line 2007  pool_cache_invalidate_groups(pool_cache_
  *      Note: For pool caches that provide constructed objects, there   *      Note: For pool caches that provide constructed objects, there
  *      is an assumption that another level of synchronization is occurring   *      is an assumption that another level of synchronization is occurring
  *      between the input to the constructor and the cache invalidation.   *      between the input to the constructor and the cache invalidation.
    *
    *      Invalidation is a costly process and should not be called from
    *      interrupt context.
  */   */
 void  void
 pool_cache_invalidate(pool_cache_t pc)  pool_cache_invalidate(pool_cache_t pc)
 {  {
         pcg_t *full, *empty, *part;  
 #if 0  
         uint64_t where;          uint64_t where;
           pcg_t *full, *empty, *part;
   
           KASSERT(!cpu_intr_p() && !cpu_softintr_p());
   
         if (ncpu < 2 || !mp_online) {          if (ncpu < 2 || !mp_online) {
                 /*                  /*
                  * We might be called early enough in the boot process                   * We might be called early enough in the boot process
                  * for the CPU data structures to not be fully initialized.                   * for the CPU data structures to not be fully initialized.
                  * In this case, simply gather the local CPU's cache now                   * In this case, transfer the content of the local CPU's
                  * since it will be the only one running.                   * cache back into global cache as only this CPU is currently
                    * running.
                  */                   */
                 pool_cache_xcall(pc);                  pool_cache_transfer(pc);
         } else {          } else {
                 /*                  /*
                  * Gather all of the CPU-specific caches into the                   * Signal all CPUs that they must transfer their local
                  * global cache.                   * cache back to the global pool then wait for the xcall to
                    * complete.
                  */                   */
                 where = xc_broadcast(0, (xcfunc_t)pool_cache_xcall, pc, NULL);                  where = xc_broadcast(0, (xcfunc_t)pool_cache_transfer,
                       pc, NULL);
                 xc_wait(where);                  xc_wait(where);
         }          }
 #endif  
           /* Empty pool caches, then invalidate objects */
         mutex_enter(&pc->pc_lock);          mutex_enter(&pc->pc_lock);
         full = pc->pc_fullgroups;          full = pc->pc_fullgroups;
         empty = pc->pc_emptygroups;          empty = pc->pc_emptygroups;
Line 2415  pool_cache_put_paddr(pool_cache_t pc, vo
Line 2423  pool_cache_put_paddr(pool_cache_t pc, vo
 }  }
   
 /*  /*
  * pool_cache_xcall:   * pool_cache_transfer:
  *   *
  *      Transfer objects from the per-CPU cache to the global cache.   *      Transfer objects from the per-CPU cache to the global cache.
  *      Run within a cross-call thread.   *      Run within a cross-call thread.
  */   */
 static void  static void
 pool_cache_xcall(pool_cache_t pc)  pool_cache_transfer(pool_cache_t pc)
 {  {
         pool_cache_cpu_t *cc;          pool_cache_cpu_t *cc;
         pcg_t *prev, *cur, **list;          pcg_t *prev, *cur, **list;

Legend:
Removed from v.1.195  
changed lines
  Added in v.1.196

CVSweb <webmaster@jp.NetBSD.org>