if (create)
flags |= O_CREAT;
+ if (g_conf->filestore_odsync_write) {
+ flags |= O_DSYNC;
+ }
Index index2;
if (!index) {
if (!force_clear_omap) {
if (hardlink == 0) {
- wbthrottle.clear_object(o); // should be only non-cache ref
+ if (!m_disable_wbthrottle) {
+ wbthrottle.clear_object(o); // should be only non-cache ref
+ }
fdcache.clear(o);
return 0;
} else if (hardlink == 1) {
if (g_conf->filestore_debug_inject_read_err) {
debug_obj_on_delete(o);
}
- wbthrottle.clear_object(o); // should be only non-cache ref
+ if (!m_disable_wbthrottle) {
+ wbthrottle.clear_object(o); // should be only non-cache ref
+ }
fdcache.clear(o);
} else {
/* Ensure that replay of this op doesn't result in the object_map
next_osr_id(0),
throttle_ops(g_conf->filestore_caller_concurrency),
throttle_bytes(g_conf->filestore_caller_concurrency),
+ m_disable_wbthrottle(g_conf->filestore_odsync_write ||
+ !g_conf->filestore_wbthrottle_enable),
m_ondisk_finisher_num(g_conf->filestore_ondisk_finisher_threads),
m_apply_finisher_num(g_conf->filestore_apply_finisher_threads),
op_tp(g_ceph_context, "FileStore::op_tp", "tp_fstore_op", g_conf->filestore_op_threads, "filestore_op_threads"),
switch (f_type) {
#if defined(__linux__)
case BTRFS_SUPER_MAGIC:
- wbthrottle.set_fs(WBThrottle::BTRFS);
+ if (!m_disable_wbthrottle){
+ wbthrottle.set_fs(WBThrottle::BTRFS);
+ }
break;
case XFS_SUPER_MAGIC:
index->cleanup();
}
}
-
- wbthrottle.start();
+ if (!m_disable_wbthrottle) {
+ wbthrottle.start();
+ } else {
+ dout(0) << "mount INFO: WbThrottle is disabled" << dendl;
+ if (g_conf->filestore_odsync_write) {
+ dout(0) << "mount INFO: O_DSYNC write is enabled" << dendl;
+ }
+ }
sync_thread.create("filestore_sync");
if (!(generic_flags & SKIP_JOURNAL_REPLAY)) {
sync_cond.Signal();
lock.Unlock();
sync_thread.join();
-
- wbthrottle.stop();
+ if (!m_disable_wbthrottle) {
+ wbthrottle.stop();
+ }
close_current_fd:
VOID_TEMP_FAILURE_RETRY(::close(current_fd));
current_fd = -1;
sync_cond.Signal();
lock.Unlock();
sync_thread.join();
- wbthrottle.stop();
+ if (!m_disable_wbthrottle){
+ wbthrottle.stop();
+ }
op_tp.stop();
journal_stop();
void FileStore::_do_op(OpSequencer *osr, ThreadPool::TPHandle &handle)
{
- wbthrottle.throttle();
+ if (!m_disable_wbthrottle) {
+ wbthrottle.throttle();
+ }
// inject a stall?
if (g_conf->filestore_inject_stall) {
int orig = g_conf->filestore_inject_stall;
int rc = backend->_crc_update_write(**fd, offset, len, bl);
assert(rc >= 0);
}
-
- // flush?
- if (!replaying &&
- g_conf->filestore_wbthrottle_enable)
+
+ if (replaying || m_disable_wbthrottle) {
+ if (fadvise_flags & CEPH_OSD_OP_FLAG_FADVISE_DONTNEED) {
+ posix_fadvise(**fd, 0, 0, POSIX_FADV_DONTNEED);
+ }
+ } else {
wbthrottle.queue_wb(fd, oid, offset, len,
- fadvise_flags & CEPH_OSD_OP_FLAG_FADVISE_DONTNEED);
+ fadvise_flags & CEPH_OSD_OP_FLAG_FADVISE_DONTNEED);
+ }
+
lfn_close(fd);
out:
logger->tinc(l_os_commit_len, dur);
apply_manager.commit_finish();
- wbthrottle.clear();
+ if (!m_disable_wbthrottle) {
+ wbthrottle.clear();
+ }
logger->set(l_os_committing, 0);