summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
84daadd)
It's my understanding that the zfs_fsyncer_key TSD was added as
a performance omtimization to reduce contention on the zl_lock
from zil_commit(). This issue manifested itself as very long
(100+ms) fsync() system call times for fsync() heavy workloads.
However, under Linux I'm not seeing the same contention that
was originally described. Therefore, I'm removing this code
in order to ween ourselves off any dependence on TSD. If the
original performance issue reappears on Linux we can revisit
fixing it without resorting to TSD.
This just leaves one small ZFS TSD consumer. If it can be
cleanly removed from the code we'll be able to shed the SPL
TSD implementation entirely.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes zfsonlinux/spl#174
#define SHORT_FID_LEN (sizeof (zfid_short_t) - sizeof (uint16_t))
#define LONG_FID_LEN (sizeof (zfid_long_t) - sizeof (uint16_t))
#define SHORT_FID_LEN (sizeof (zfid_short_t) - sizeof (uint16_t))
#define LONG_FID_LEN (sizeof (zfid_long_t) - sizeof (uint16_t))
-extern uint_t zfs_fsyncer_key;
-
extern int zfs_suspend_fs(zfs_sb_t *zsb);
extern int zfs_resume_fs(zfs_sb_t *zsb, const char *osname);
extern int zfs_userspace_one(zfs_sb_t *zsb, zfs_userquota_prop_t type,
extern int zfs_suspend_fs(zfs_sb_t *zsb);
extern int zfs_resume_fs(zfs_sb_t *zsb, const char *osname);
extern int zfs_userspace_one(zfs_sb_t *zsb, zfs_userquota_prop_t type,
list_destroy(&zfsdev_state_list);
}
list_destroy(&zfsdev_state_list);
}
extern uint_t rrw_tsd_key;
#ifdef DEBUG
extern uint_t rrw_tsd_key;
#ifdef DEBUG
if ((error = zfs_attach()) != 0)
goto out2;
if ((error = zfs_attach()) != 0)
goto out2;
- tsd_create(&zfs_fsyncer_key, NULL);
tsd_create(&rrw_tsd_key, NULL);
printk(KERN_NOTICE "ZFS: Loaded module v%s-%s%s, "
tsd_create(&rrw_tsd_key, NULL);
printk(KERN_NOTICE "ZFS: Loaded module v%s-%s%s, "
- tsd_destroy(&zfs_fsyncer_key);
tsd_destroy(&rrw_tsd_key);
printk(KERN_NOTICE "ZFS: Unloaded module v%s-%s%s\n",
tsd_destroy(&rrw_tsd_key);
printk(KERN_NOTICE "ZFS: Unloaded module v%s-%s%s\n",
{
itx_wr_state_t write_state;
boolean_t slogging;
{
itx_wr_state_t write_state;
boolean_t slogging;
ssize_t immediate_write_sz;
if (zil_replaying(zilog, tx) || zp->z_unlinked)
ssize_t immediate_write_sz;
if (zil_replaying(zilog, tx) || zp->z_unlinked)
else
write_state = WR_NEED_COPY;
else
write_state = WR_NEED_COPY;
- if ((fsync_cnt = (uintptr_t)tsd_get(zfs_fsyncer_key)) != 0) {
- (void) tsd_set(zfs_fsyncer_key, (void *)(fsync_cnt - 1));
- }
-
while (resid) {
itx_t *itx;
lr_write_t *lr;
while (resid) {
itx_t *itx;
lr_write_t *lr;
itx->itx_private = ZTOZSB(zp);
itx->itx_private = ZTOZSB(zp);
- if (!(ioflag & (FSYNC | FDSYNC)) && (zp->z_sync_cnt == 0) &&
- (fsync_cnt == 0))
+ if (!(ioflag & (FSYNC | FDSYNC)) && (zp->z_sync_cnt == 0))
itx->itx_sync = B_FALSE;
zil_itx_assign(zilog, itx, tx);
itx->itx_sync = B_FALSE;
zil_itx_assign(zilog, itx, tx);
}
EXPORT_SYMBOL(zfs_readdir);
}
EXPORT_SYMBOL(zfs_readdir);
-ulong_t zfs_fsync_sync_cnt = 4;
-
int
zfs_fsync(struct inode *ip, int syncflag, cred_t *cr)
{
znode_t *zp = ITOZ(ip);
zfs_sb_t *zsb = ITOZSB(ip);
int
zfs_fsync(struct inode *ip, int syncflag, cred_t *cr)
{
znode_t *zp = ITOZ(ip);
zfs_sb_t *zsb = ITOZSB(ip);
- (void) tsd_set(zfs_fsyncer_key, (void *)zfs_fsync_sync_cnt);
-
if (zsb->z_os->os_sync != ZFS_SYNC_DISABLED) {
ZFS_ENTER(zsb);
ZFS_VERIFY_ZP(zp);
if (zsb->z_os->os_sync != ZFS_SYNC_DISABLED) {
ZFS_ENTER(zsb);
ZFS_VERIFY_ZP(zp);