mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
buf: Dynamically allocate per-CPU buffer queues
To reduce static bloat. No functional change intended. PR: 269572 Reviewed by: mjg, kib, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39808
This commit is contained in:
parent
78cfa762eb
commit
e72f7ed43e
1 changed files with 4 additions and 1 deletions
|
|
@ -118,7 +118,7 @@ struct bufqueue {
|
|||
#define BQ_ASSERT_LOCKED(bq) mtx_assert(BQ_LOCKPTR((bq)), MA_OWNED)
|
||||
|
||||
struct bufdomain {
|
||||
struct bufqueue bd_subq[MAXCPU + 1]; /* Per-cpu sub queues + global */
|
||||
struct bufqueue *bd_subq;
|
||||
struct bufqueue bd_dirtyq;
|
||||
struct bufqueue *bd_cleanq;
|
||||
struct mtx_padalign bd_run_lock;
|
||||
|
|
@ -1914,6 +1914,9 @@ bd_init(struct bufdomain *bd)
|
|||
{
|
||||
int i;
|
||||
|
||||
/* Per-CPU clean buf queues, plus one global queue. */
|
||||
bd->bd_subq = mallocarray(mp_maxid + 2, sizeof(struct bufqueue),
|
||||
M_BIOBUF, M_WAITOK | M_ZERO);
|
||||
bd->bd_cleanq = &bd->bd_subq[mp_maxid + 1];
|
||||
bq_init(bd->bd_cleanq, QUEUE_CLEAN, mp_maxid + 1, "bufq clean lock");
|
||||
bq_init(&bd->bd_dirtyq, QUEUE_DIRTY, -1, "bufq dirty lock");
|
||||
|
|
|
|||
Loading…
Reference in a new issue