[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 and

version, 2007/07/29 11:34:47 version, 2007/08/20 21:27:37
Line 1615  pool_reclaim(struct pool *pp)
Line 1615  pool_reclaim(struct pool *pp)
  * Drain pools, one at a time.   * Drain pools, one at a time.
  *   *
  * Note, we must never be called from an interrupt context.   * Note, we must never be called from an interrupt context.
    * XXX Pool can disappear while draining.
  */   */
 void  void
 pool_drain(void *arg)  pool_drain(void *arg)
Line 2170  pool_cache_destruct_object(struct pool_c
Line 2172  pool_cache_destruct_object(struct pool_c
         pool_put(pc->pc_pool, object);          pool_put(pc->pc_pool, object);
 }  }
    * pool_do_cache_invalidate_grouplist:
    *      Invalidate a single grouplist and destruct all objects.
    *      XXX This is too expensive.  We should swap the list then
    *      unlock.
 static void  static void
 pool_do_cache_invalidate_grouplist(struct pool_cache_grouplist *pcgsl,  pool_do_cache_invalidate_grouplist(struct pool_cache_grouplist *pcgsl,
     struct pool_cache *pc, struct pool_pagelist *pq,      struct pool_cache *pc, struct pool_pagelist *pq,
     struct pool_cache_grouplist *pcgdl)      struct pool_cache_grouplist *pcgdl)
 {  {
         struct pool_cache_group *pcg, *npcg;          struct pool_cache_group *pcg;
         void *object;          void *object;
         for (pcg = LIST_FIRST(pcgsl); pcg != NULL; pcg = npcg) {          KASSERT(mutex_owned(&pc->pc_lock));
                 npcg = LIST_NEXT(pcg, pcg_list);          KASSERT(mutex_owned(&pc->pc_pool->pr_lock));
           while ((pcg = LIST_FIRST(pcgsl)) != NULL) {
                   LIST_REMOVE(pcg, pcg_list);
                   LIST_INSERT_HEAD(pcgdl, pcg, pcg_list);
                   pc->pc_nitems -= pcg->pcg_avail;
                 while (pcg->pcg_avail != 0) {                  while (pcg->pcg_avail != 0) {
                         object = pcg_get(pcg, NULL);                          object = pcg_get(pcg, NULL);
                         if (pc->pc_dtor != NULL)                          if (pc->pc_dtor != NULL)
                                 (*pc->pc_dtor)(pc->pc_arg, object);                                  (*pc->pc_dtor)(pc->pc_arg, object);
                         pool_do_put(pc->pc_pool, object, pq);                          pool_do_put(pc->pc_pool, object, pq);
                 }                  }
                 LIST_REMOVE(pcg, pcg_list);                  mutex_enter(&pc->pc_lock);
                 LIST_INSERT_HEAD(pcgdl, pcg, pcg_list);                  mutex_enter(&pc->pc_pool->pr_lock);
         }          }
 }  }

Removed from v.  
changed lines
  Added in v.

CVSweb <webmaster@jp.NetBSD.org>