diff mbox series

[2/2] bfq: Allow short_ttime queues to have waker

Message ID 20200409170915.30570-3-jack@suse.cz (mailing list archive)
State New, archived
Headers show
Series bfq: Waker logic tweaks for dbench performance | expand

Commit Message

Jan Kara April 9, 2020, 5:09 p.m. UTC
Currently queues that have average think time shorter than slice_idle
cannot have waker. However this requirement is too strict. E.g. dbench
process always submits a one or two IOs (which is enough to pull its
average think time below slice_idle) and then blocks waiting for jbd2
thread to commit a transaction. Due to idling logic jbd2 thread is
often forced to wait for dbench's idle timer to trigger to be able to
submit its IO and this severely delays the overall benchmark progress.

E.g. on my test machine current dbench single-thread throughput is ~80
MB/s, with this patch it is ~200 MB/s.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 block/bfq-iosched.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Paolo Valente Jan. 10, 2021, 9:20 a.m. UTC | #1
> Il giorno 9 apr 2020, alle ore 19:09, Jan Kara <jack@suse.cz> ha scritto:
> 
> Currently queues that have average think time shorter than slice_idle
> cannot have waker. However this requirement is too strict. E.g. dbench
> process always submits a one or two IOs (which is enough to pull its
> average think time below slice_idle) and then blocks waiting for jbd2
> thread to commit a transaction. Due to idling logic jbd2 thread is
> often forced to wait for dbench's idle timer to trigger to be able to
> submit its IO and this severely delays the overall benchmark progress.
> 
> E.g. on my test machine current dbench single-thread throughput is ~80
> MB/s, with this patch it is ~200 MB/s.
> 

Hi Jan,
I've modified this logic a little bit (in patches that I'm going to
submit).  And I don't see your boost in my tests.  So it's difficult
for me to validate this change.  If ok for you, you could test it on
top of the patches that I'll submit.  If you see a boost, and (as I
expect) I won't see any regression, this improvement is very welcome
for me.

Thanks,
Paolo

> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
> block/bfq-iosched.c | 1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 18f85d474c9c..416473ba80c8 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -1928,7 +1928,6 @@ static void bfq_add_request(struct request *rq)
> 		 * I/O-plugging interval for bfqq.
> 		 */
> 		if (bfqd->last_completed_rq_bfqq &&
> -		    !bfq_bfqq_has_short_ttime(bfqq) &&
> 		    ktime_get_ns() - bfqd->last_completion <
> 		    200 * NSEC_PER_USEC) {
> 			if (bfqd->last_completed_rq_bfqq != bfqq &&
> -- 
> 2.16.4
>
Jan Kara Jan. 13, 2021, 1:25 p.m. UTC | #2
On Sun 10-01-21 10:20:19, Paolo Valente wrote:
> 
> 
> > Il giorno 9 apr 2020, alle ore 19:09, Jan Kara <jack@suse.cz> ha scritto:
> > 
> > Currently queues that have average think time shorter than slice_idle
> > cannot have waker. However this requirement is too strict. E.g. dbench
> > process always submits a one or two IOs (which is enough to pull its
> > average think time below slice_idle) and then blocks waiting for jbd2
> > thread to commit a transaction. Due to idling logic jbd2 thread is
> > often forced to wait for dbench's idle timer to trigger to be able to
> > submit its IO and this severely delays the overall benchmark progress.
> > 
> > E.g. on my test machine current dbench single-thread throughput is ~80
> > MB/s, with this patch it is ~200 MB/s.
> > 
> 
> Hi Jan,
> I've modified this logic a little bit (in patches that I'm going to
> submit).  And I don't see your boost in my tests.  So it's difficult
> for me to validate this change.  If ok for you, you could test it on
> top of the patches that I'll submit.  If you see a boost, and (as I
> expect) I won't see any regression, this improvement is very welcome
> for me.

As I wrote in the cover letter, I'm not really convinced that patch
conceptually makes sence. What you later implemented should be definitely a
more sophisticated approach to the problem. So I'd just discard this patch.

								Honza
diff mbox series

Patch

diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 18f85d474c9c..416473ba80c8 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1928,7 +1928,6 @@  static void bfq_add_request(struct request *rq)
 		 * I/O-plugging interval for bfqq.
 		 */
 		if (bfqd->last_completed_rq_bfqq &&
-		    !bfq_bfqq_has_short_ttime(bfqq) &&
 		    ktime_get_ns() - bfqd->last_completion <
 		    200 * NSEC_PER_USEC) {
 			if (bfqd->last_completed_rq_bfqq != bfqq &&