mbuf: Don't support PAGE_SIZE < 4K
The Vax supported such things, but FreeBSD does not. This further implies that MJUMPAGESIZE > MCLBYTES so assert this and remove code handling them being equal. Reviewed by: kp, imp, jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D36320
This commit is contained in:
parent
e9ad2964f5
commit
840327e5dd
@ -63,6 +63,9 @@ __FBSDID("$FreeBSD$");
|
||||
#include <vm/uma.h>
|
||||
#include <vm/uma_dbg.h>
|
||||
|
||||
_Static_assert(MJUMPAGESIZE > MCLBYTES,
|
||||
"Cluster must be smaller than a jumbo page");
|
||||
|
||||
/*
|
||||
* In FreeBSD, Mbufs and Mbuf Clusters are allocated from UMA
|
||||
* Zones.
|
||||
|
@ -894,11 +894,9 @@ m_gettype(int size)
|
||||
case MCLBYTES:
|
||||
type = EXT_CLUSTER;
|
||||
break;
|
||||
#if MJUMPAGESIZE != MCLBYTES
|
||||
case MJUMPAGESIZE:
|
||||
type = EXT_JUMBOP;
|
||||
break;
|
||||
#endif
|
||||
case MJUM9BYTES:
|
||||
type = EXT_JUMBO9;
|
||||
break;
|
||||
@ -944,11 +942,9 @@ m_getzone(int size)
|
||||
case MCLBYTES:
|
||||
zone = zone_clust;
|
||||
break;
|
||||
#if MJUMPAGESIZE != MCLBYTES
|
||||
case MJUMPAGESIZE:
|
||||
zone = zone_jumbop;
|
||||
break;
|
||||
#endif
|
||||
case MJUM9BYTES:
|
||||
zone = zone_jumbo9;
|
||||
break;
|
||||
@ -1068,11 +1064,9 @@ m_cljset(struct mbuf *m, void *cl, int type)
|
||||
case EXT_CLUSTER:
|
||||
size = MCLBYTES;
|
||||
break;
|
||||
#if MJUMPAGESIZE != MCLBYTES
|
||||
case EXT_JUMBOP:
|
||||
size = MJUMPAGESIZE;
|
||||
break;
|
||||
#endif
|
||||
case EXT_JUMBO9:
|
||||
size = MJUM9BYTES;
|
||||
break;
|
||||
|
@ -200,9 +200,7 @@
|
||||
|
||||
#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */
|
||||
|
||||
#if PAGE_SIZE < 2048
|
||||
#define MJUMPAGESIZE MCLBYTES
|
||||
#elif PAGE_SIZE <= 8192
|
||||
#if PAGE_SIZE <= 8192
|
||||
#define MJUMPAGESIZE PAGE_SIZE
|
||||
#else
|
||||
#define MJUMPAGESIZE (8 * 1024)
|
||||
|
Loading…
Reference in New Issue
Block a user