From: Miod Vallat Subject: kernel: less pool code on installation media To: tech@openbsd.org Date: Sat, 24 Oct 2026 19:43:04 +0000 The pool garbage collection code only runs (from init_main.c) on MULTIPROCESSOR kernels. The relevant code and global variables can be omitted on single-processor kernels. Index: kern/subr_pool.c =================================================================== RCS file: /OpenBSD/src/sys/kern/subr_pool.c,v diff -u -p -r1.243 subr_pool.c --- kern/subr_pool.c 29 Jan 2026 01:04:35 -0000 1.243 +++ kern/subr_pool.c 24 Oct 2026 19:40:02 -0000 @@ -103,11 +103,13 @@ pl_enter(struct pool *pp, union pool_loc { pp->pr_lock_ops->pl_enter(pl); } +#ifdef MULTIPROCESSOR static inline int pl_enter_try(struct pool *pp, union pool_lock *pl) { return pp->pr_lock_ops->pl_enter_try(pl); } +#endif static inline void pl_leave(struct pool *pp, union pool_lock *pl) { @@ -265,11 +267,13 @@ void pool_print1(struct pool *, const c __attribute__((__format__(__kprintf__,1,2)))); #endif +#ifdef MULTIPROCESSOR /* stale page garbage collectors */ void pool_gc_sched(void *); struct timeout pool_gc_tick = TIMEOUT_INITIALIZER(pool_gc_sched, NULL); void pool_gc_pages(void *); struct task pool_gc_task = TASK_INITIALIZER(pool_gc_pages, NULL); +#endif /* MULTIPROCESSOR */ #define POOL_WAIT_FREE SEC_TO_NSEC(1) #define POOL_WAIT_GC SEC_TO_NSEC(8) @@ -1551,6 +1555,7 @@ sysctl_dopool(int *name, u_int namelen, } #endif /* SMALL_KERNEL */ +#ifdef MULTIPROCESSOR void pool_gc_sched(void *null) { @@ -1567,10 +1572,8 @@ pool_gc_pages(void *null) rw_enter_read(&pool_lock); s = splvm(); /* XXX go to splvm until all pools _setipl properly */ SIMPLEQ_FOREACH(pp, &pool_head, pr_poollist) { -#ifdef MULTIPROCESSOR if (pp->pr_cache != NULL) pool_cache_gc(pp); -#endif if (pp->pr_nidle <= pp->pr_minpages || /* guess */ !pl_enter_try(pp, &pp->pr_lock)) /* try */ @@ -1595,6 +1598,7 @@ pool_gc_pages(void *null) timeout_add_sec(&pool_gc_tick, 1); } +#endif /* MULTIPROCESSOR */ /* * Pool backend allocators.