login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
June
»
14
Re: CFQ read performance regression
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Miklos Szeredi
Subject:
Re: CFQ read performance regression
Date: Monday, June 14, 2010 - 10:59 am
On Sat, 2010-05-01 at 14:13 +0200, Corrado Zoccolo wrote:
quoted text
> On Wed, Apr 28, 2010 at 10:02 PM, Vivek Goyal <vgoyal@redhat.com> wrote: > > On Tue, Apr 27, 2010 at 07:25:14PM +0200, Corrado Zoccolo wrote: > >> On Mon, Apr 26, 2010 at 9:14 PM, Vivek Goyal <vgoyal@redhat.com> wrote: > >> > On Sat, Apr 24, 2010 at 10:36:48PM +0200, Corrado Zoccolo wrote: > >> > > >> > [..] > >> >> >> Anyway, if that's the case, then we probably need to allow IO from > >> >> >> multiple sequential readers and keep a watch on throughput. If throughput > >> >> >> drops then reduce the number of parallel sequential readers. Not sure how > >> >> >> much of code that is but with multiple cfqq going in parallel, ioprio > >> >> >> logic will more or less stop working in CFQ (on multi-spindle hardware). > >> >> Hi Vivek, > >> >> I tried to implement exactly what you are proposing, see the attached patches. > >> >> I leverage the queue merging features to let multiple cfqqs share the > >> >> disk in the same timeslice. > >> >> I changed the queue split code to trigger on throughput drop instead > >> >> of on seeky pattern, so diverging queues can remain merged if they > >> >> have good throughput. Moreover, I measure the max bandwidth reached by > >> >> single queues and merged queues (you can see the values in the > >> >> bandwidth sysfs file). > >> >> If merged queues can outperform non-merged ones, the queue merging > >> >> code will try to opportunistically merge together queues that cannot > >> >> submit enough requests to fill half of the NCQ slots. I'd like to know > >> >> if you can see any improvements out of this on your hardware. There > >> >> are some magic numbers in the code, you may want to try tuning them. > >> >> Note that, since the opportunistic queue merging will start happening > >> >> only after merged queues have shown to reach higher bandwidth than > >> >> non-merged queues, you should use the disk for a while before trying > >> >> the test (and you can check sysfs), or the merging will not happen. > >> > > >> > Hi Corrado, > >> > > >> > I ran these patches and I did not see any improvement. I think the reason > >> > being that no cooperative queue merging took place and we did not have > >> > any data for throughput with coop flag on. > >> > > >> > #cat /sys/block/dm-3/queue/iosched/bandwidth > >> > 230 753 0 > >> > > >> > I think we need to implement something similiar to hw_tag detection logic > >> > where we allow dispatches from multiple sync-idle queues at a time and try > >> > to observe the BW. After certain window once we have observed the window, > >> > then set the system behavior accordingly. > >> Hi Vivek, > >> thanks for testing. Can you try changing the condition to enable the > >> queue merging to also consider the case in which max_bw[1] == 0 && > >> max_bw[0] > 100MB/s (notice that max_bw is measured in > >> sectors/jiffie). > >> This should rule out low end disks, and enable merging where it can be > >> beneficial. > >> If the results are good, but we find this enabling condition > >> unreliable, then we can think of a better way, but I'm curious to see > >> if the results are promising before thinking to the details. > > > > Ok, I made some changes and now some queue merging seems to be happening > > and I am getting little better BW. This will require more debugging. I > > will try to spare some time later. > > > > Kernel=2.6.34-rc5-corrado-multicfq > > DIR= /mnt/iostmnt/fio DEV= /dev/mapper/mpathe > > Workload=bsr iosched=cfq Filesz=1G bs=16K > > ========================================================================== > > job Set NR ReadBW(KB/s) MaxClat(us) WriteBW(KB/s) MaxClat(us) > > --- --- -- ------------ ----------- ------------- ----------- > > bsr 1 1 136457 67353 0 0 > > bsr 1 2 148008 192415 0 0 > > bsr 1 4 180223 535205 0 0 > > bsr 1 8 166983 542326 0 0 > > bsr 1 16 176617 832188 0 0 > > > > Output of iosched/bandwidth > > > > 0 546 740 > > > > I did following changes on top of your patch. > This is becoming interesting. I think a major limitation of the > current approach is that it is too easy for a merged queue to be > separated again. > My code: > if (cfq_cfqq_coop(cfqq) && bw <= cfqd->max_bw[1] * 9/10) > cfq_mark_cfqq_split_coop(cfqq); > will immediately split any merged queue as soon as max_bw[1] grows too > much, so it should be based on max_bw[0]. > Moreover, this code will likely split off all cics from the merged > queue, while it would be much better to split off only the cics that > are receiving less than their fair share of the BW (this will also > improve the fairness of the scheduler when queues are merged).
Is there any update on the status of this issue? Thanks, Miklos
quoted text
> Corrado > > > > Vivek > > > > --- > > block/cfq-iosched.c | 11 +++++++++-- > > 1 files changed, 9 insertions(+), 2 deletions(-) > > > > diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c > > index 4e9e015..7589c44 100644 > > --- a/block/cfq-iosched.c > > +++ b/block/cfq-iosched.c > > @@ -243,6 +243,7 @@ struct cfq_data { > > */ > > int hw_tag_est_depth; > > unsigned int hw_tag_samples; > > + unsigned int cfqq_merged_samples; > > /* > > * performance measurements > > * max_bw is indexed by coop flag. > > @@ -1736,10 +1737,14 @@ static struct cfq_queue *cfqq_close(struct cfq_data *cfqd, > > // Opportunistic queue merging could be beneficial even on far queues > > // We enable it only on NCQ disks, if we observed that merged queues > > // can reach higher bandwidth than single queues. > > + // 204 sectors per jiffy is equivalent to 100MB/s on 1000 HZ conf. > > + // Allow merge if we don't have sufficient merged cfqq samples. > > rs = cur_cfqq->allocated[READ] + cur_cfqq->allocated[WRITE]; > > - if (cfqd->hw_tag && cfqd->max_bw[1] > cfqd->max_bw[0] && > > + if (cfqd->hw_tag > > + && (cfqd->max_bw[1] > cfqd->max_bw[0] > > + || (cfqd->max_bw[0] > 204 && !sample_valid(cfqd->cfqq_merged_samples))) > > // Do not overload the device queue > > - rs < cfqd->hw_tag_est_depth / 2) { > > + && rs < cfqd->hw_tag_est_depth / 2) { > > unsigned r1 = __cfqq->allocated[READ] + __cfqq->allocated[WRITE]; > > unsigned r2 = __cfqq1->allocated[READ] + __cfqq1->allocated[WRITE]; > > // Prefer merging with a queue that has fewer pending requests > > @@ -1750,6 +1755,8 @@ static struct cfq_queue *cfqq_close(struct cfq_data *cfqd, > > // Do not merge if the merged queue would have too many requests > > if (r1 + rs > cfqd->hw_tag_est_depth / 2) > > return NULL; > > + cfqd->cfqq_merged_samples++; > > + > > // Merge only if the BW of the two queues is comparable > > if (abs(__cfqq->last_bw - cur_cfqq->last_bw) * 4 < cfqd->max_bw[0]) > > return __cfqq; > > -- > > 1.6.2.5 > > > >> > >> Thanks, > >> Corrado > >> > >> > > >> > Kernel=2.6.34-rc5-corrado-multicfq > >> > DIR= /mnt/iostmnt/fio DEV= /dev/mapper/mpathe > >> > Workload=bsr iosched=cfq Filesz=2G bs=4K > >> > ========================================================================== > >> > job Set NR ReadBW(KB/s) MaxClat(us) WriteBW(KB/s) MaxClat(us) > >> > --- --- -- ------------ ----------- ------------- ----------- > >> > bsr 1 1 126590 61448 0 0 > >> > bsr 1 2 127849 242843 0 0 > >> > bsr 1 4 131886 508021 0 0 > >> > bsr 1 8 131890 398241 0 0 > >> > bsr 1 16 129167 454244 0 0 > >> > > >> > Thanks > >> > Vivek > >> > > >> > >> > >> > >> -- > >> __________________________________________________________________________ > >> > >> dott. Corrado Zoccolo
mailto:czoccolo@gmail.com
> >> PhD - Department of Computer Science - University of Pisa, Italy > >> -------------------------------------------------------------------------- > >> The self-confidence of a warrior is not the self-confidence of the average > >> man. The average man seeks certainty in the eyes of the onlooker and calls > >> that self-confidence. The warrior seeks impeccability in his own eyes and > >> calls that humbleness. > >> Tales of Power - C. Castaneda > > > > >
--
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:
CFQ read performance regression
, Miklos Szeredi
, (Fri Apr 16, 5:27 am)
Re: CFQ read performance regression
, Chris
, (Fri Apr 16, 10:06 am)
Re: CFQ read performance regression
, Corrado Zoccolo
, (Sat Apr 17, 5:46 am)
Re: CFQ read performance regression
, Miklos Szeredi
, (Mon Apr 19, 4:46 am)
Re: CFQ read performance regression
, Corrado Zoccolo
, (Tue Apr 20, 1:50 pm)
Re: CFQ read performance regression
, Miklos Szeredi
, (Wed Apr 21, 6:25 am)
Re: CFQ read performance regression
, Miklos Szeredi
, (Wed Apr 21, 9:05 am)
Re: CFQ read performance regression
, Corrado Zoccolo
, (Thu Apr 22, 12:59 am)
Re: CFQ read performance regression
, Miklos Szeredi
, (Thu Apr 22, 3:23 am)
Re: CFQ read performance regression
, Jan Kara
, (Thu Apr 22, 8:53 am)
Re: CFQ read performance regression
, Vivek Goyal
, (Thu Apr 22, 1:31 pm)
Re: CFQ read performance regression
, Miklos Szeredi
, (Fri Apr 23, 3:48 am)
Re: CFQ read performance regression
, Miklos Szeredi
, (Fri Apr 23, 3:57 am)
Re: CFQ read performance regression
, Corrado Zoccolo
, (Sat Apr 24, 1:36 pm)
Re: CFQ read performance regression
, Vivek Goyal
, (Mon Apr 26, 6:50 am)
Re: CFQ read performance regression
, Vivek Goyal
, (Mon Apr 26, 12:14 pm)
Re: CFQ read performance regression
, Corrado Zoccolo
, (Tue Apr 27, 10:25 am)
Re: CFQ read performance regression
, Vivek Goyal
, (Wed Apr 28, 1:02 pm)
Re: CFQ read performance regression
, Corrado Zoccolo
, (Sat May 1, 5:13 am)
Re: CFQ read performance regression
, Miklos Szeredi
, (Mon Jun 14, 10:59 am)
Re: CFQ read performance regression
, Vivek Goyal
, (Mon Jun 14, 11:06 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 041/196] kobject: add kobject_init_and_add function
Lukas Hejtmanek
Re: Another libata error related to OCZ SSD
Greg Kroah-Hartman
[PATCH 023/196] MCP_UCB1200: Convert from class_device to device
Florian Fainelli
Re: System clock runs too fast after 2.6.27 -> 2.6.28.1 upgrade
Christoph Lameter
[patch 1/4] mmu_notifier: Core code
git
:
Johannes Schindelin
Re: [PATCH 1/2] Add strbuf_initf()
John Bito
[EGIT] Push to GitHub caused corruption
Jakub Narebski
Re: [PATCH 0/2] gitweb: patch view
Junio C Hamano
Re: [PATCH] When a remote is added but not fetched, tell the user.
Andy Parkins
Re: [RFC] Submodules in GIT
git-commits-head
:
Linux Kernel Mailing List
ahci: Workaround HW bug for SB600/700 SATA controller PMP support
Linux Kernel Mailing List
V4L/DVB (11086): au0828: rename macro for currently non-function VBI support
Linux Kernel Mailing List
ceph: client types
Linux Kernel Mailing List
ceph: on-wire types
Linux Kernel Mailing List
crypto: chainiv - Use kcrypto_wq instead of keventd_wq
linux-netdev
:
Andrew Morton
Re: [Bugme-new] [Bug 14969] New: b44: WOL does not work in suspended state
Giuseppe CAVALLARO
Re: [PATCH 03/13] stmmac: add the new Header file for stmmac platform data
Taku Izumi
[PATCH 3/3] ixgbe: add registers etc. printout code just before resetting adapters
Eric Dumazet
rps: some comments
Thomas Gleixner
Re: [RFC PATCH 02/12] On Tue, 23 Sep 2008, David Miller wrote:
openbsd-misc
:
Stephan Andreas
problems with login after xlock in OpenBSD release 4.7
pmc
Make A Change. Alcoholism and Drug Addiction Treatment
ropers
Re: what exactly is enc0?
Fuad NAHDI
Re: What does your environment look like?
Matthew Szudzik
Typo on OpenBSD 4.4 CD Set
Colocation donated by:
Syndicate