diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2000-09-30 06:30:39 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2000-09-30 06:30:39 +0000 |
commit | 73f1784807220f05cc9a20691da50435c061eb8b (patch) | |
tree | e3c6d31ca476b0f48e789798870347804b32d00c /sys/pc98 | |
parent | 25fc889685a44ae4fb8e0c34e5dedd869a99a1c9 (diff) | |
download | FreeBSD-src-73f1784807220f05cc9a20691da50435c061eb8b.zip FreeBSD-src-73f1784807220f05cc9a20691da50435c061eb8b.tar.gz |
Big mbuf subsystem diff #1: incorporate mutexes and fix things up somewhat
to accomodate the changes.
Here's a list of things that have changed (I may have left out a few); for a
relatively complete list, see http://people.freebsd.org/~bmilekic/mtx_journal
* Remove old (once useful) mcluster code for MCLBYTES > PAGE_SIZE which
nobody uses anymore. It was great while it lasted, but now we're moving
onto bigger and better things (Approved by: wollman).
* Practically re-wrote the allocation macros in sys/sys/mbuf.h to accomodate
new allocations which grab the necessary lock.
* Make sure that necessary mbstat variables are manipulated with
corresponding atomic() routines.
* Changed the "wait" routines, cleaned it up, made one routine that does
the job.
* Generalized MWAKEUP() macro. Got rid of m_retry and m_retryhdr, as they
are now included in the generalized "wait" routines.
* Sleep routines now use msleep().
* Free lists have locks.
* etc... probably other stuff I'm missing...
Things to look out for and work on later:
* find a better way to (dynamically) adjust EXT_COUNTERS
* move necessity to recurse on a lock from drain routines by providing
lock-free lower-level version of MFREE() (and possibly m_free()?).
* checkout include of mutex.h in sys/sys/mbuf.h - probably violating
general philosophy here.
The code has been reviewed quite a bit, but problems may arise... please,
don't panic! Send me Emails: bmilekic@freebsd.org
Reviewed by: jlemon, cp, alfred, others?
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/i386/machdep.c | 15 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 15 |
2 files changed, 4 insertions, 26 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 4973936..d3299d9 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -145,8 +145,6 @@ extern void initializecpu(void); static void cpu_startup __P((void *)); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) -static MALLOC_DEFINE(M_MBUF, "mbuf", "mbuf"); - #ifdef PC98 int need_pre_dma_flush; /* If 1, use wbinvd befor DMA transfer. */ int need_post_dma_flush; /* If 1, use invd after DMA transfer. */ @@ -413,18 +411,9 @@ again: (16*(ARG_MAX+(PAGE_SIZE*3)))); /* - * Finally, allocate mbuf pool. + * XXX: Mbuf system machine-specific initializations should + * go here, if anywhere. */ - { - vm_offset_t mb_map_size; - - mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES + - (nmbclusters + nmbufs / 4) * sizeof(union mext_refcnt); - mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE)); - mb_map = kmem_suballoc(kmem_map, (vm_offset_t *)&mbutl, - &maxaddr, mb_map_size); - mb_map->system_map = 1; - } /* * Initialize callouts diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 4973936..d3299d9 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -145,8 +145,6 @@ extern void initializecpu(void); static void cpu_startup __P((void *)); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) -static MALLOC_DEFINE(M_MBUF, "mbuf", "mbuf"); - #ifdef PC98 int need_pre_dma_flush; /* If 1, use wbinvd befor DMA transfer. */ int need_post_dma_flush; /* If 1, use invd after DMA transfer. */ @@ -413,18 +411,9 @@ again: (16*(ARG_MAX+(PAGE_SIZE*3)))); /* - * Finally, allocate mbuf pool. + * XXX: Mbuf system machine-specific initializations should + * go here, if anywhere. */ - { - vm_offset_t mb_map_size; - - mb_map_size = nmbufs * MSIZE + nmbclusters * MCLBYTES + - (nmbclusters + nmbufs / 4) * sizeof(union mext_refcnt); - mb_map_size = roundup2(mb_map_size, max(MCLBYTES, PAGE_SIZE)); - mb_map = kmem_suballoc(kmem_map, (vm_offset_t *)&mbutl, - &maxaddr, mb_map_size); - mb_map->system_map = 1; - } /* * Initialize callouts |