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
02c7d9a64f
commit
f0c6b798a3
@ -158,7 +158,7 @@ static int arc_grow_retry = 60;
|
|||||||
*/
|
*/
|
||||||
static int arc_min_prefetch_lifespan;
|
static int arc_min_prefetch_lifespan;
|
||||||
|
|
||||||
extern int zfs_prefetch_enable;
|
extern int zfs_prefetch_disable;
|
||||||
static int arc_dead;
|
static int arc_dead;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3552,21 +3552,21 @@ arc_init(void)
|
|||||||
mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL);
|
mutex_init(&zfs_write_limit_lock, NULL, MUTEX_DEFAULT, NULL);
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#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;
|
prefetch_tunable_set = 1;
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
if (prefetch_tunable_set == 0) {
|
if (prefetch_tunable_set == 0) {
|
||||||
printf("ZFS NOTICE: prefetch is disabled by default on i386"
|
printf("ZFS NOTICE: prefetch is disabled by default on i386"
|
||||||
" - add enable to tunable to change.\n" );
|
" - add enable to tunable to change.\n" );
|
||||||
zfs_prefetch_enable=0;
|
zfs_prefetch_disable=1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) &&
|
if ((((uint64_t)physmem * PAGESIZE) < (1ULL << 32)) &&
|
||||||
prefetch_tunable_set == 0) {
|
prefetch_tunable_set == 0) {
|
||||||
printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set"
|
printf("ZFS NOTICE: system has less than 4GB and prefetch enable is not set"
|
||||||
"... disabling.\n");
|
"... disabling.\n");
|
||||||
zfs_prefetch_enable=0;
|
zfs_prefetch_disable=1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* Warn about ZFS memory and address space requirements. */
|
/* 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;
|
uint64_t blkid;
|
||||||
int nblks, i, err;
|
int nblks, i, err;
|
||||||
|
|
||||||
if (zfs_prefetch_enable == 0)
|
if (zfs_prefetch_disable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (len == 0) { /* they're interested in the bonus buffer */
|
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.
|
* 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 */
|
/* max # of streams per zfetch */
|
||||||
uint32_t zfetch_max_streams = 8;
|
uint32_t zfetch_max_streams = 8;
|
||||||
@ -49,8 +49,8 @@ uint32_t zfetch_block_cap = 256;
|
|||||||
uint64_t zfetch_array_rd_sz = 1024 * 1024;
|
uint64_t zfetch_array_rd_sz = 1024 * 1024;
|
||||||
|
|
||||||
SYSCTL_DECL(_vfs_zfs);
|
SYSCTL_DECL(_vfs_zfs);
|
||||||
SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_enable, CTLFLAG_RDTUN,
|
SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_disable, CTLFLAG_RDTUN,
|
||||||
&zfs_prefetch_enable, 0, "Enable prefetch for systems with less than 4GB");
|
&zfs_prefetch_disable, 0, "Disable prefetch");
|
||||||
SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
|
SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH");
|
||||||
TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
|
TUNABLE_INT("vfs.zfs.zfetch.max_streams", &zfetch_max_streams);
|
||||||
SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RDTUN,
|
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;
|
unsigned int blkshft;
|
||||||
uint64_t blksz;
|
uint64_t blksz;
|
||||||
|
|
||||||
if (zfs_prefetch_enable == 0)
|
if (zfs_prefetch_disable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* files that aren't ln2 blocksz are only one block -- nothing to do */
|
/* 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,
|
int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
|
||||||
uint64_t size, struct page *pp, dmu_tx_t *tx);
|
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.
|
* Asynchronously try to read in the data.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user