pjd has requested that I keep the tunable as zfs_prefetch_disable to minimize gratuitous
differences with Opensolaris' ZFS Sorry for the churn
This commit is contained in:
parent
807f4c1bf8
commit
8060c5388d
@ -158,7 +158,7 @@ static int arc_grow_retry = 60;
|
||||
*/
|
||||
static int arc_min_prefetch_lifespan;
|
||||
|
||||
extern int zfs_prefetch_enable;
|
||||
extern int zfs_prefetch_disable;
|
||||
static int arc_dead;
|
||||
|
||||
/*
|
||||
@ -3552,21 +3552,21 @@ arc_init(void)
|
||||
mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL);
|
||||
|
||||
#ifdef _KERNEL
|
||||
if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_enable", &zfs_prefetch_enable))
|
||||
if (TUNABLE_INT_FETCH("vfs.zfs.prefetch_disable", &zfs_prefetch_disable))
|
||||
prefetch_tunable_set = 1;
|
||||
|
||||
#ifdef __i386__
|
||||
if (prefetch_tunable_set == 0) {
|
||||
printf("ZFS NOTICE: prefetch is disabled by default on i386"
|
||||
" - add enable to tunable to change.\n" );
|
||||
zfs_prefetch_enable=0;
|
||||
zfs_prefetch_disable=1;
|
||||
}
|
||||
#else
|
||||
if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) &&
|
||||
prefetch_tunable_set == 0) {
|
||||
printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set"
|
||||
"... disabling.\n");
|
||||
zfs_prefetch_enable=0;
|
||||
zfs_prefetch_disable=1;
|
||||
}
|
||||
#endif
|
||||
/* Warn about ZFS memory and address space requirements. */
|
||||
|
@ -326,7 +326,7 @@ dmu_prefetch(objset_t *os, uint64_t object, uint64_t offset, uint64_t len)
|
||||
uint64_t blkid;
|
||||
int nblks, i, err;
|
||||
|
||||
if (zfs_prefetch_enable == 0)
|
||||
if (zfs_prefetch_disable)
|
||||
return;
|
||||
|
||||
if (len == 0) { /* they're interested in the bonus buffer */
|
||||
|
@ -37,7 +37,7 @@
|
||||
* until we can get this working the way we want it to.
|
||||
*/
|
||||
|
||||
int zfs_prefetch_enable = 1;
|
||||
int zfs_prefetch_disable = 0;
|
||||
|
||||
/* max # of streams per zfetch */
|
||||
uint32_t zfetch_max_streams = 8;
|
||||
@ -49,8 +49,8 @@ uint32_t zfetch_block_cap = 256;
|
||||
uint64_t zfetch_array_rd_sz = 1024 * 1024;
|
||||
|
||||
SYSCTL_DECL(_vfs_zfs);
|
||||
SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_enable, CTLFLAG_RDTUN,
|
||||
&zfs_prefetch_enable, 0, "Enable prefetch for systems with less than 4GB");
|
||||
SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN,
|
||||
&zfs_prefetch_disable, 0, "Disable prefetch");
|
||||
SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
|
||||
TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
|
||||
SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RDTUN,
|
||||
@ -598,7 +598,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset, uint64_t size, int prefetched)
|
||||
unsigned int blkshft;
|
||||
uint64_t blksz;
|
||||
|
||||
if (zfs_prefetch_enable == 0)
|
||||
if (zfs_prefetch_disable)
|
||||
return;
|
||||
|
||||
/* files that aren't ln2 blocksz are only one block -- nothing to do */
|
||||
|
@ -457,7 +457,7 @@ int dmu_write_uio(objset_t *os, uint64_t object, struct uio *uio, uint64_t size,
|
||||
int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
|
||||
uint64_t size, struct page *pp, dmu_tx_t *tx);
|
||||
|
||||
extern int zfs_prefetch_enable;
|
||||
extern int zfs_prefetch_disable;
|
||||
|
||||
/*
|
||||
* Asynchronously try to read in the data.
|
||||
|
Loading…
Reference in New Issue
Block a user