login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
15
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to block devices
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Jens Axboe
Subject:
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to block devices
Date: Thursday, April 15, 2010 - 3:04 am
On Thu, Apr 15 2010, Anton Blanchard wrote:
quoted text
> > We are seeing a large regression in database performance on recent kernels. > The database opens a block device with O_DIRECT|O_SYNC and a number of threads > write to different regions of the file at the same time. > > A simple test case is below. I haven't defined DEVICE to anything since getting > it wrong will destroy your data :) On an 3 disk LVM with a 64k chunk size we > see about 17MB/sec and only a few threads in IO wait: > > procs -----io---- -system-- -----cpu------ > r b bi bo in cs us sy id wa st > 0 3 0 16170 656 2259 0 0 86 14 0 > 0 2 0 16704 695 2408 0 0 92 8 0 > 0 2 0 17308 744 2653 0 0 86 14 0 > 0 2 0 17933 759 2777 0 0 89 10 0 > > Most threads are blocking in vfs_fsync_range, which has: > > mutex_lock(&mapping->host->i_mutex); > err = fop->fsync(file, dentry, datasync); > if (!ret) > ret = err; > mutex_unlock(&mapping->host->i_mutex); > > Commit 148f948ba877f4d3cdef036b1ff6d9f68986706a (vfs: Introduce new helpers for > syncing after writing to O_SYNC file or IS_SYNC inode) offers some explanation > of what is going on: > > Use these new helpers for syncing from generic VFS functions. This makes > O_SYNC writes to block devices acquire i_mutex for syncing. If we really > care about this, we can make block_fsync() drop the i_mutex and reacquire > it before it returns. > > Thanks Jan for such a good commit message! The patch below drops the i_mutex > in blkdev_fsync as suggested. With it the testcase improves from 17MB/s to > 68M/sec: > > procs -----io---- -system-- -----cpu------ > r b bi bo in cs us sy id wa st > 0 7 0 65536 1000 3878 0 0 70 30 0 > 0 34 0 69632 1016 3921 0 1 46 53 0 > 0 57 0 69632 1000 3921 0 0 55 45 0 > 0 53 0 69640 754 4111 0 0 81 19 0 > > I'd appreciate any comments from the I/O guys on if this is the right approach.
Looks good to me, I see Jan already made a few style suggestions. -- Jens Axboe --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] Fix regression in O_DIRECT|O_SYNC writes to block ...
, Anton Blanchard
, (Wed Apr 14, 9:40 pm)
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to bl ...
, Jan Kara
, (Thu Apr 15, 1:47 am)
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to bl ...
, Jens Axboe
, (Thu Apr 15, 3:04 am)
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to bl ...
, Christoph Hellwig
, (Thu Apr 15, 3:42 am)
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to bl ...
, Jan Kara
, (Thu Apr 15, 6:34 am)
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to bl ...
, Anton Blanchard
, (Mon Apr 19, 7:26 pm)
[PATCH] Fix regression in O_DIRECT|O_SYNC writes to block ...
, Anton Blanchard
, (Mon Apr 19, 7:30 pm)
Re: [PATCH] Fix regression in O_DIRECT|O_SYNC writes to bl ...
, Jan Kara
, (Thu Apr 22, 12:25 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
monstr
[PATCH 46/56] microblaze_v2: headers files entry.h current.h mman.h registers.h se...
Jan Engelhardt
Re: Linux Security *Module* Framework (Was: LSM conversion to static interface)
Dave Jones
Re: Why do so many machines need "noapic"?
Michael Moore
Re: underage models, pre teen models, lolita porn, young preteens, little lolitas
Lars-Peter Clausen
[PATCH v4] MMC: Add JZ4740 mmc driver
git
:
Andy Parkins
git-fetch fails with error code 128
Eli Zaretskii
Re: Switching from CVS to GIT
Jan Harkes
Re: git-svn and huge data and modifying the git-svn-HEAD branch directly
Dan Chokola
Re: how do you "force a pull"?
Johan Herland
Re: Comment on weak refs
git-commits-head
:
Linux Kernel Mailing List
No need to do lock_super() for exclusion in generic_shutdown_super()
Linux Kernel Mailing List
x86, msr: Export the register-setting MSR functions via /dev/*/msr
Linux Kernel Mailing List
MIPS: SMTC: Fix lockup in smtc_distribute_timer
Linux Kernel Mailing List
Input: gpio-keys - add support for disabling gpios through sysfs
Linux Kernel Mailing List
sh-sci: update receive error handling for muxed irqs
linux-netdev
:
Patrick McHardy
Re: no reassembly for outgoing packets on RAW socket
Ilpo Järvinen
net-next/unix: BUG: using smp_processor_id() in preemptible
Herbert Xu
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Evgeniy Polyakov
Re: virt-manager broken by bind(0) in net-next.
Eric Dumazet
Re: [PATCH] conntrack: use SLAB_DESTROY_BY_RCU for nf_conn structs
openbsd-misc
:
elitdostlar
Seks partneri arayan bayanlar bu adreste - 8878xs706x6438
Marcus Andree
Re: This is what Linus Torvalds calls openBSD crowd
Lars D. Noodén
Re: sshd.config and AllowUsers
Henning Brauer
Re: Sun Blade 1000?
Laurens Vets
Re: OT: opinions on IDS / IPS solutions
Colocation donated by:
Syndicate