Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2022 17:35:59 GMT
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 840327e5ddf3 - main - mbuf: Don't support PAGE_SIZE < 4K
Message-ID:  <202208241735.27OHZxPH013241@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=840327e5ddf304c1a15949c23b7806ec10d32c2b

commit 840327e5ddf304c1a15949c23b7806ec10d32c2b
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-08-24 17:34:07 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-08-24 17:34:07 +0000

    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
---
 sys/kern/kern_mbuf.c | 3 +++
 sys/sys/mbuf.h       | 6 ------
 sys/sys/param.h      | 4 +---
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index 1c0c5624b6d7..a302545192fe 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -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.
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 9e50a640eac0..601b1e92c172 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -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;
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 59516c139136..6254b73f76a6 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208241735.27OHZxPH013241>