[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.110.2.2 and 1.111

version 1.110.2.2, 2006/03/01 09:28:46 version 1.111, 2006/01/26 15:07:25
Line 482  pool_init(struct pool *pp, size_t size, 
Line 482  pool_init(struct pool *pp, size_t size, 
                 flags |= PR_LOGGING;                  flags |= PR_LOGGING;
 #endif  #endif
   
   #ifdef POOL_SUBPAGE
           /*
            * XXX We don't provide a real `nointr' back-end
            * yet; all sub-pages come from a kmem back-end.
            * maybe some day...
            */
           if (palloc == NULL) {
                   extern struct pool_allocator pool_allocator_kmem_subpage;
                   palloc = &pool_allocator_kmem_subpage;
           }
           /*
            * We'll assume any user-specified back-end allocator
            * will deal with sub-pages, or simply don't care.
            */
   #else
         if (palloc == NULL)          if (palloc == NULL)
                 palloc = &pool_allocator_kmem;                  palloc = &pool_allocator_kmem;
 #ifdef POOL_SUBPAGE  
         if (size > palloc->pa_pagesz) {  
                 if (palloc == &pool_allocator_kmem)  
                         palloc = &pool_allocator_kmem_fullpage;  
                 else if (palloc == &pool_allocator_nointr)  
                         palloc = &pool_allocator_nointr_fullpage;  
         }  
 #endif /* POOL_SUBPAGE */  #endif /* POOL_SUBPAGE */
         if ((palloc->pa_flags & PA_INITIALIZED) == 0) {          if ((palloc->pa_flags & PA_INITIALIZED) == 0) {
                 if (palloc->pa_pagesz == 0)                  if (palloc->pa_pagesz == 0) {
   #ifdef POOL_SUBPAGE
                           if (palloc == &pool_allocator_kmem)
                                   palloc->pa_pagesz = PAGE_SIZE;
                           else
                                   palloc->pa_pagesz = POOL_SUBPAGE;
   #else
                         palloc->pa_pagesz = PAGE_SIZE;                          palloc->pa_pagesz = PAGE_SIZE;
   #endif /* POOL_SUBPAGE */
                   }
   
                 TAILQ_INIT(&palloc->pa_list);                  TAILQ_INIT(&palloc->pa_list);
   
Line 2174  pool_cache_reclaim(struct pool_cache *pc
Line 2190  pool_cache_reclaim(struct pool_cache *pc
 void    *pool_page_alloc(struct pool *, int);  void    *pool_page_alloc(struct pool *, int);
 void    pool_page_free(struct pool *, void *);  void    pool_page_free(struct pool *, void *);
   
 #ifdef POOL_SUBPAGE  
 struct pool_allocator pool_allocator_kmem_fullpage = {  
         pool_page_alloc, pool_page_free, 0,  
 };  
 #else  
 struct pool_allocator pool_allocator_kmem = {  struct pool_allocator pool_allocator_kmem = {
         pool_page_alloc, pool_page_free, 0,          pool_page_alloc, pool_page_free, 0,
 };  };
 #endif  
   
 void    *pool_page_alloc_nointr(struct pool *, int);  void    *pool_page_alloc_nointr(struct pool *, int);
 void    pool_page_free_nointr(struct pool *, void *);  void    pool_page_free_nointr(struct pool *, void *);
   
 #ifdef POOL_SUBPAGE  
 struct pool_allocator pool_allocator_nointr_fullpage = {  
         pool_page_alloc_nointr, pool_page_free_nointr, 0,  
 };  
 #else  
 struct pool_allocator pool_allocator_nointr = {  struct pool_allocator pool_allocator_nointr = {
         pool_page_alloc_nointr, pool_page_free_nointr, 0,          pool_page_alloc_nointr, pool_page_free_nointr, 0,
 };  };
 #endif  
   
 #ifdef POOL_SUBPAGE  #ifdef POOL_SUBPAGE
 void    *pool_subpage_alloc(struct pool *, int);  void    *pool_subpage_alloc(struct pool *, int);
 void    pool_subpage_free(struct pool *, void *);  void    pool_subpage_free(struct pool *, void *);
   
 struct pool_allocator pool_allocator_kmem = {  struct pool_allocator pool_allocator_kmem_subpage = {
         pool_subpage_alloc, pool_subpage_free, POOL_SUBPAGE,          pool_subpage_alloc, pool_subpage_free, 0,
 };  
   
 void    *pool_subpage_alloc_nointr(struct pool *, int);  
 void    pool_subpage_free_nointr(struct pool *, void *);  
   
 struct pool_allocator pool_allocator_nointr = {  
         pool_subpage_alloc, pool_subpage_free, POOL_SUBPAGE,  
 };  };
 #endif /* POOL_SUBPAGE */  #endif /* POOL_SUBPAGE */
   
Line 2385  pool_subpage_free(struct pool *pp, void 
Line 2382  pool_subpage_free(struct pool *pp, void 
   
 /* We don't provide a real nointr allocator.  Maybe later. */  /* We don't provide a real nointr allocator.  Maybe later. */
 void *  void *
 pool_subpage_alloc_nointr(struct pool *pp, int flags)  pool_page_alloc_nointr(struct pool *pp, int flags)
 {  {
   
         return (pool_subpage_alloc(pp, flags));          return (pool_subpage_alloc(pp, flags));
 }  }
   
 void  void
 pool_subpage_free_nointr(struct pool *pp, void *v)  pool_page_free_nointr(struct pool *pp, void *v)
 {  {
   
         pool_subpage_free(pp, v);          pool_subpage_free(pp, v);
 }  }
 #endif /* POOL_SUBPAGE */  #else
 void *  void *
 pool_page_alloc_nointr(struct pool *pp, int flags)  pool_page_alloc_nointr(struct pool *pp, int flags)
 {  {
Line 2412  pool_page_free_nointr(struct pool *pp, v
Line 2409  pool_page_free_nointr(struct pool *pp, v
   
         uvm_km_free_poolpage_cache(kernel_map, (vaddr_t) v);          uvm_km_free_poolpage_cache(kernel_map, (vaddr_t) v);
 }  }
   #endif /* POOL_SUBPAGE */

Legend:
Removed from v.1.110.2.2  
changed lines
  Added in v.1.111

CVSweb <webmaster@jp.NetBSD.org>