linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
	Jeff Garzik <jgarzik@pobox.com>
Subject: [PATCH RESEND 0/1] AHCI: Optimize interrupt processing
Date: Tue, 21 May 2013 21:00:27 +0200	[thread overview]
Message-ID: <cover.1369155164.git.agordeev@redhat.com> (raw)

Hi Tejun,

This is a patch I sent to Jeff few months ago. As you asked, I am
resending it on top of 3.10-rc2 Linus tree. Jeff has said he
applied this patch, but I am not sure what exactly it means ;)

Also, I am not sure about my reading of the statistics and the
trade-off I identified (below), so this patch is a RFC.

The numbers are taken by running 'if=/dev/sd{a,b,c} of=/dev/null'
All time values is in us.

Before this update host lock average holdtime was 3.266532061 and
average waittime was 0.009832679 [1]. After the update average
holdtime (slightly) rose up to 0.335267418 while average waittime
decreased to 0.000320469 [2]. Which means host lock with local
interrupt disabled is held roughly the same while the average
waittime dropped 30 times.

After this update port events are handled with local interrupts
enabled and compete on individual per-port locks with average
holdtime 1.540987475 and average waittime 0.000714864 [3].
Comparing to [1], ata_scsi_queuecmd() holds port locks 2 times
less and waits for locks 13 times less.

The downside of this change is introduction of a kernel thread
and (supposedly) increased total average time of handling a
AHCI interrupt - at most 1.5 times.

The upside is better access times from ata_scsi_queuecmd() to
port locks and moving port interrupt handling out of the
hardware interrupt context.

Thanks!

Lock usage statistics.

	1. ahci_interrupt vs ata_scsi_queuecmd (host->lock)

Test	holdtime-total	waittime-total	acquisitions	holdtime-avg	waittime-avg
#
01.	22732497.77	93399.89	06393367	3.555637862	0.014608874
02.	20358052.08	52869.72	06454133	3.154265969	0.008191607
03.	20322516.57	54981.40	06459318	3.146232554	0.008511951
04.	18558686.89	39178.05	06469468	2.868657344	0.006055838
05.	19069799.90	31961.00	06455953	2.953831897	0.004950625
06.	23783542.56	97159.79	06387322	3.723554654	0.015211350
07.	23889266.74	102625.45	06386666	3.740491007	0.016068705
08.	19284522.61	32655.91	06450568	2.989585198	0.005062486
							-----------	-----------
avg							3.266532061	0.009832679

	2. ahci_single_irq_intr vs ahci_port_thread_fn (host->lock)


Alexander Gordeev (1):
  AHCI: Optimize interrupt processing

 drivers/ata/acard-ahci.c    |    8 ++---
 drivers/ata/ahci.c          |   54 ++++++++++++++++++-------------
 drivers/ata/ahci.h          |   10 +++--
 drivers/ata/ahci_platform.c |    3 +-
 drivers/ata/libahci.c       |   74 +++++++++++++++++++++++++------------------
 5 files changed, 85 insertions(+), 64 deletions(-)

-- 
1.7.7.6


-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

             reply	other threads:[~2013-05-21 18:59 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 19:00 Alexander Gordeev [this message]
2013-05-21 19:00 ` [PATCH RESEND 1/1] AHCI: Optimize interrupt processing Alexander Gordeev
2013-05-21 23:50 ` [PATCH RESEND 0/1] " Tejun Heo
2013-05-22 14:39   ` Alexander Gordeev
2013-05-22 17:03     ` Jens Axboe
2013-07-11 10:26       ` Alexander Gordeev
2013-07-11 23:00         ` Nicholas A. Bellinger
2013-07-12  7:46           ` Alexander Gordeev
2013-07-13  5:20             ` Nicholas A. Bellinger
2013-07-16 18:32               ` Alexander Gordeev
2013-07-16 21:38                 ` Nicholas A. Bellinger
2013-07-17 16:19                   ` Alexander Gordeev
2013-07-18 18:51                     ` Nicholas A. Bellinger
2013-07-18 19:12                       ` Mike Christie
2013-07-19  0:23                         ` Nicholas A. Bellinger
2013-07-19  0:30                           ` Jens Axboe
2013-07-19  1:03                             ` Nicholas A. Bellinger
2013-07-19  6:34                               ` Nicholas A. Bellinger
2013-07-19 15:33                                 ` James Bottomley
2013-07-19 21:01                                   ` Nicholas A. Bellinger
2013-07-20  4:56                                     ` Nicholas A. Bellinger
2013-07-20 14:48                                       ` Mike Christie
2013-07-20 22:14                                         ` Nicholas A. Bellinger
2013-07-20 23:57                                         ` Jens Axboe
2013-08-09 19:15                                         ` Alexander Gordeev
2013-08-09 20:17                                           ` Nicholas A. Bellinger
2013-08-15 16:23                                             ` Alexander Gordeev
2013-08-16  2:19                                               ` Nicholas A. Bellinger
2013-08-16 16:41                                                 ` Alexander Gordeev
2013-08-16 17:46                                                   ` Nicholas A. Bellinger
2013-08-28 15:56                                                 ` Alexander Gordeev
2013-09-20 15:19                                                 ` Alexander Gordeev
2013-09-20 20:41                                                   ` Nicholas A. Bellinger
2013-10-03 11:06                                         ` Christoph Hellwig
2013-10-07 14:44                                           ` Alexander Gordeev
2013-07-22 15:03                                       ` Alexander Gordeev
2013-07-22 21:10                                         ` Nicholas A. Bellinger
2013-07-25 10:16                                           ` Alexander Gordeev
2013-07-25 22:08                                             ` Nicholas A. Bellinger
2013-07-26  2:09                                               ` Jens Axboe
2013-07-26 21:14                                                 ` Nicholas A. Bellinger
2013-07-27  0:43                                                   ` Nicholas A. Bellinger
2013-07-29 11:18                                                     ` Alexander Gordeev
2013-07-29 14:08                                                       ` Jens Axboe
2013-07-29 19:19                                                       ` Nicholas A. Bellinger
2013-07-31  4:16                                                         ` Marc C
2013-07-31 10:23                                                           ` Tejun Heo
2013-07-29 11:50                                                     ` Tejun Heo
2013-07-29 19:11                                                       ` Nicholas A. Bellinger
2013-07-29 11:46                                                   ` Tejun Heo
2013-07-29 14:03                                                     ` Jens Axboe
2013-08-09  8:23                                                     ` Alexander Gordeev
2013-08-09 14:15                                                       ` Tejun Heo
2013-08-09 14:24                                                       ` Jens Axboe
2013-08-09 15:07                                                         ` Alexander Gordeev
2013-08-09 15:52                                                           ` Jens Axboe
2013-08-09 16:46                                                             ` Alexander Gordeev
2013-08-09 17:07                                                               ` Jens Axboe
2013-08-12 15:21                                                                 ` Alexander Gordeev
2013-07-29  7:28                                                 ` Hannes Reinecke
2013-07-31 17:11                                             ` Alexander Gordeev
2013-07-19 15:58                           ` Mike Christie
2013-07-19 21:05                             ` Nicholas A. Bellinger
2013-07-18 19:14                       ` Nicholas A. Bellinger
2013-07-18 21:21                         ` Jens Axboe
2014-09-11 12:42   ` Alexander Gordeev
2014-09-11 12:44     ` [PATCH v2] " Alexander Gordeev
2014-09-13  4:43       ` Tejun Heo
2014-09-11 13:36     ` [PATCH RESEND 0/1] " Bartlomiej Zolnierkiewicz
2014-09-13  4:46     ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1369155164.git.agordeev@redhat.com \
    --to=agordeev@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).