Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Remove POOL_SUBPAGE, it is unused, undocumented, and add...



details:   https://anonhg.NetBSD.org/src/rev/1279c7458e5f
branches:  trunk
changeset: 997791:1279c7458e5f
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Mar 26 18:31:30 2019 +0000

description:
Remove POOL_SUBPAGE, it is unused, undocumented, and adds confusion.

diffstat:

 sys/kern/subr_pool.c |  74 ++-------------------------------------------------
 sys/sys/pool.h       |   7 +----
 2 files changed, 5 insertions(+), 76 deletions(-)

diffs (154 lines):

diff -r e9c3f948310d -r 1279c7458e5f sys/kern/subr_pool.c
--- a/sys/kern/subr_pool.c      Tue Mar 26 16:41:06 2019 +0000
+++ b/sys/kern/subr_pool.c      Tue Mar 26 18:31:30 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_pool.c,v 1.243 2019/03/18 20:34:48 maxv Exp $     */
+/*     $NetBSD: subr_pool.c,v 1.244 2019/03/26 18:31:30 maxv Exp $     */
 
 /*
  * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014, 2015, 2018
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.243 2019/03/18 20:34:48 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.244 2019/03/26 18:31:30 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -82,11 +82,6 @@
 #define        PHPOOL_FREELIST_NELEM(idx) \
        (((idx) == 0) ? 0 : BITMAP_SIZE * (1 << (idx)))
 
-#ifdef POOL_SUBPAGE
-/* Pool of subpages for use by normal pools. */
-static struct pool psppool;
-#endif
-
 #if defined(KASAN)
 #define POOL_REDZONE
 #endif
@@ -545,10 +540,6 @@
                pool_init(&phpool[idx], sz, 0, 0, 0,
                    phpool_names[idx], &pool_allocator_meta, IPL_VM);
        }
-#ifdef POOL_SUBPAGE
-       pool_init(&psppool, POOL_SUBPAGE, POOL_SUBPAGE, 0,
-           PR_RECURSIVE, "psppool", &pool_allocator_meta, IPL_VM);
-#endif
 
        size = sizeof(pcg_t) +
            (PCG_NOBJECTS_NORMAL - 1) * sizeof(pcgpair_t);
@@ -659,14 +650,7 @@
 
        if (palloc == NULL)
                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 */
+
        if (!cold)
                mutex_enter(&pool_allocator_lock);
        if (palloc->pa_refcnt++ == 0) {
@@ -2692,50 +2676,17 @@
 void   *pool_page_alloc(struct pool *, int);
 void   pool_page_free(struct pool *, void *);
 
-#ifdef POOL_SUBPAGE
-struct pool_allocator pool_allocator_kmem_fullpage = {
-       .pa_alloc = pool_page_alloc,
-       .pa_free = pool_page_free,
-       .pa_pagesz = 0
-};
-#else
 struct pool_allocator pool_allocator_kmem = {
        .pa_alloc = pool_page_alloc,
        .pa_free = pool_page_free,
        .pa_pagesz = 0
 };
-#endif
-
-#ifdef POOL_SUBPAGE
-struct pool_allocator pool_allocator_nointr_fullpage = {
-       .pa_alloc = pool_page_alloc,
-       .pa_free = pool_page_free,
-       .pa_pagesz = 0
-};
-#else
+
 struct pool_allocator pool_allocator_nointr = {
        .pa_alloc = pool_page_alloc,
        .pa_free = pool_page_free,
        .pa_pagesz = 0
 };
-#endif
-
-#ifdef POOL_SUBPAGE
-void   *pool_subpage_alloc(struct pool *, int);
-void   pool_subpage_free(struct pool *, void *);
-
-struct pool_allocator pool_allocator_kmem = {
-       .pa_alloc = pool_subpage_alloc,
-       .pa_free = pool_subpage_free,
-       .pa_pagesz = POOL_SUBPAGE
-};
-
-struct pool_allocator pool_allocator_nointr = {
-       .pa_alloc = pool_subpage_alloc,
-       .pa_free = pool_subpage_free,
-       .pa_pagesz = POOL_SUBPAGE
-};
-#endif /* POOL_SUBPAGE */
 
 struct pool_allocator pool_allocator_big[] = {
        {
@@ -3024,23 +2975,6 @@
 
 #endif /* POOL_REDZONE */
 
-
-#ifdef POOL_SUBPAGE
-/* Sub-page allocator, for machines with large hardware pages. */
-void *
-pool_subpage_alloc(struct pool *pp, int flags)
-{
-       return pool_get(&psppool, flags);
-}
-
-void
-pool_subpage_free(struct pool *pp, void *v)
-{
-       pool_put(&psppool, v);
-}
-
-#endif /* POOL_SUBPAGE */
-
 #if defined(DDB)
 static bool
 pool_in_page(struct pool *pp, struct pool_item_header *ph, uintptr_t addr)
diff -r e9c3f948310d -r 1279c7458e5f sys/sys/pool.h
--- a/sys/sys/pool.h    Tue Mar 26 16:41:06 2019 +0000
+++ b/sys/sys/pool.h    Tue Mar 26 18:31:30 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pool.h,v 1.85 2019/03/17 19:57:54 maxv Exp $   */
+/*     $NetBSD: pool.h,v 1.86 2019/03/26 18:31:30 maxv Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000, 2007 The NetBSD Foundation, Inc.
@@ -287,11 +287,6 @@
 extern struct pool_allocator pool_allocator_kmem;
 extern struct pool_allocator pool_allocator_nointr;
 extern struct pool_allocator pool_allocator_meta;
-#ifdef POOL_SUBPAGE
-/* The above are subpage allocators in this case. */
-extern struct pool_allocator pool_allocator_kmem_fullpage;
-extern struct pool_allocator pool_allocator_nointr_fullpage;
-#endif
 
 void           pool_subsystem_init(void);
 



Home | Main Index | Thread Index | Old Index