Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140068257
D2330.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D2330.diff
View Options
Index: head/sys/fs/nfs/nfsport.h
===================================================================
--- head/sys/fs/nfs/nfsport.h
+++ head/sys/fs/nfs/nfsport.h
@@ -950,7 +950,7 @@
};
#ifndef NFS_MAXBSIZE
-#define NFS_MAXBSIZE MAXBSIZE
+#define NFS_MAXBSIZE MAXBCACHEBUF
#endif
/*
Index: head/sys/fs/nfsclient/nfs_clvfsops.c
===================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c
+++ head/sys/fs/nfsclient/nfs_clvfsops.c
@@ -201,16 +201,16 @@
}
if (nmp->nm_rsize > maxio || nmp->nm_rsize == 0)
nmp->nm_rsize = maxio;
- if (nmp->nm_rsize > MAXBSIZE)
- nmp->nm_rsize = MAXBSIZE;
+ if (nmp->nm_rsize > NFS_MAXBSIZE)
+ nmp->nm_rsize = NFS_MAXBSIZE;
if (nmp->nm_readdirsize > maxio || nmp->nm_readdirsize == 0)
nmp->nm_readdirsize = maxio;
if (nmp->nm_readdirsize > nmp->nm_rsize)
nmp->nm_readdirsize = nmp->nm_rsize;
if (nmp->nm_wsize > maxio || nmp->nm_wsize == 0)
nmp->nm_wsize = maxio;
- if (nmp->nm_wsize > MAXBSIZE)
- nmp->nm_wsize = MAXBSIZE;
+ if (nmp->nm_wsize > NFS_MAXBSIZE)
+ nmp->nm_wsize = NFS_MAXBSIZE;
/*
* Calculate the size used for io buffers. Use the larger
Index: head/sys/kern/vfs_bio.c
===================================================================
--- head/sys/kern/vfs_bio.c
+++ head/sys/kern/vfs_bio.c
@@ -805,6 +805,7 @@
struct buf *bp;
int i;
+ CTASSERT(MAXBCACHEBUF >= MAXBSIZE);
mtx_init(&bqclean, "bufq clean lock", NULL, MTX_DEF);
mtx_init(&bqdirty, "bufq dirty lock", NULL, MTX_DEF);
mtx_init(&rbreqlock, "runningbufspace lock", NULL, MTX_DEF);
@@ -846,8 +847,8 @@
* by the system.
*/
maxbufspace = (long)nbuf * BKVASIZE;
- hibufspace = lmax(3 * maxbufspace / 4, maxbufspace - MAXBSIZE * 10);
- lobufspace = hibufspace - MAXBSIZE;
+ hibufspace = lmax(3 * maxbufspace / 4, maxbufspace - MAXBCACHEBUF * 10);
+ lobufspace = hibufspace - MAXBCACHEBUF;
/*
* Note: The 16 MiB upper limit for hirunningspace was chosen
@@ -857,9 +858,9 @@
* The lower 1 MiB limit is the historical upper limit for
* hirunningspace.
*/
- hirunningspace = lmax(lmin(roundup(hibufspace / 64, MAXBSIZE),
+ hirunningspace = lmax(lmin(roundup(hibufspace / 64, MAXBCACHEBUF),
16 * 1024 * 1024), 1024 * 1024);
- lorunningspace = roundup((hirunningspace * 2) / 3, MAXBSIZE);
+ lorunningspace = roundup((hirunningspace * 2) / 3, MAXBCACHEBUF);
/*
* Limit the amount of malloc memory since it is wired permanently into
@@ -3073,8 +3074,9 @@
KASSERT((flags & (GB_UNMAPPED | GB_KVAALLOC)) != GB_KVAALLOC,
("GB_KVAALLOC only makes sense with GB_UNMAPPED"));
ASSERT_VOP_LOCKED(vp, "getblk");
- if (size > MAXBSIZE)
- panic("getblk: size(%d) > MAXBSIZE(%d)\n", size, MAXBSIZE);
+ if (size > MAXBCACHEBUF)
+ panic("getblk: size(%d) > MAXBCACHEBUF(%d)\n", size,
+ MAXBCACHEBUF);
if (!unmapped_buf_allowed)
flags &= ~(GB_UNMAPPED | GB_KVAALLOC);
Index: head/sys/sys/param.h
===================================================================
--- head/sys/sys/param.h
+++ head/sys/sys/param.h
@@ -233,10 +233,19 @@
* and may be made smaller at the risk of not being able to use
* filesystems which require a block size exceeding MAXBSIZE.
*
+ * MAXBCACHEBUF - Maximum size of a buffer in the buffer cache. This must
+ * be >= MAXBSIZE and can be set differently for different
+ * architectures by defining it in <machine/param.h>.
+ * Making this larger allows NFS to do larger reads/writes.
+ *
* BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the
* minimum KVM memory reservation the kernel is willing to make.
* Filesystems can of course request smaller chunks. Actual
* backing memory uses a chunk size of a page (PAGE_SIZE).
+ * The default value here can be overridden on a per-architecture
+ * basis by defining it in <machine/param.h>. This should
+ * probably be done to increase its value, when MAXBCACHEBUF is
+ * defined as a larger value in <machine/param.h>.
*
* If you make BKVASIZE too small you risk seriously fragmenting
* the buffer KVM map which may slow things down a bit. If you
@@ -248,7 +257,12 @@
* normal UFS filesystem.
*/
#define MAXBSIZE 65536 /* must be power of 2 */
+#ifndef MAXBCACHEBUF
+#define MAXBCACHEBUF MAXBSIZE /* must be a power of 2 >= MAXBSIZE */
+#endif
+#ifndef BKVASIZE
#define BKVASIZE 16384 /* must be power of 2 */
+#endif
#define BKVAMASK (BKVASIZE-1)
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 20, 7:36 PM (3 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27100295
Default Alt Text
D2330.diff (4 KB)
Attached To
Mode
D2330: Create MAXBCACHEBUF as a separate constant from MAXBSIZE
Attached
Detach File
Event Timeline
Log In to Comment