All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: "Martin A. Fink" <fink@mpe.mpg.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: SATA-performance with AHCI
Date: Tue, 12 Dec 2006 11:17:59 +0900	[thread overview]
Message-ID: <457E1157.5020302@gmail.com> (raw)
In-Reply-To: <200612041448.20176.fink@mpe.mpg.de>

Martin A. Fink wrote:
> Compared to ICH6R with AHCI OFF the only difference I can see is that with 
> AHCI the system seems to reac much faster on keyboard events and screen 
> redraw seems to be as fast as normal. It looks like that CPU usage has not 
> decreased that dramatically as I would have expected it.
> 
> Thus I did a small calculation:
> Assuming that the processor gives workloads of (a) 1B (b) 1kB (c) 64kB to the 
> DMA controller in AHCI mode to write 45 MB/s to disk, I calculate for 10% CPU 
> time usage of the 3.2 GHz Pentium
> (a) 10% * 3.2GHz / 45M calls = 7.3 CPU cycles per 1B call to DMA
> (b) 10% * 3.2GHz / 45k calls = 7.4E+03 CPU cycles per 1kB call to DMA
> (c) 10% * 3.2GHz / 720 calls = 4.8E+05 CPU cycles per 64kB call to DMA
> 
> For me (a) looks reasonable (some overhead per byte), but stupid - if 
> implemented. Giving bigger packages like (b) and (c) looks better to me, but 
> then I can't understand that huge overhead (1E3 to 1E5 cpu cycles per 
> package) for one package.
> 
> Is this normal or do I still have something wrong in my system?

It's not ata_piix or ahci that's eating up your cpu cycles.  It's
memcpy from your user program to kernel buffer.

[root]# dd if=/dev/zero of=/dev/sda bs=1M &
[1] 2649
[root]# vmstat 1
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  3      0   6216 477328   3660    0    0  2579 31377  955 1380  2  8 38 51
 0  3      0   6008 477616   3680    0    0     0 55296  404  170  0 14  0 86
 0  3      0   5772 477808   3640    0    0     0 73728  392  207  0 18  0 82
 0  3      0   5896 477680   3656    0    0     0 74240  394  207  0 18  0 82
 0  3      0   6084 477520   3656    0    0     0 73728  393  205  0 18  0 82
 1  2      0   6652 477204   3668    0    0     0 57440  401  197  0 16  0 84
 0  3      0   6136 477496   3664    0    0     0 72168  394  195  0 17  0 83
 0  3      0   6320 477316   3644    0    0     0 73728  392  207  0 19  0 81

[root]# dd if=/dev/zero of=/dev/sda bs=1M oflag=direct &
[1] 2657
[root]# vmstat 1
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 0  1      0 494568    224   3836    0    0   835 11149  480  454  1  3 78 18
 0  1      0 494568    224   3836    0    0     0 70656  406  146  0  2  0 98
 0  1      0 494568    224   3840    0    0     0 69632  393  144  0  1  0 99
 0  1      0 494568    232   3832    0    0     0 69680  396  152  0  2  0 98
 0  1      0 494568    232   3840    0    0     0 68608  392  142  0  1  0 99
 1  1      0 494568    232   3840    0    0     0 69632  395  144  0  2  0 98
 0  1      0 494576    232   3840    0    0     0 69632  393  143  0  2  0 98
 0  1      0 494576    232   3840    0    0     0 70656  395  144  0  1  0 99
 0  1      0 494576    232   3840    0    0     0 70656  394  148  0  2  0 98

-- 
tejun

      reply	other threads:[~2006-12-12  2:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 13:48 SATA-performance with AHCI Martin A. Fink
2006-12-12  2:17 ` Tejun Heo [this message]

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=457E1157.5020302@gmail.com \
    --to=htejun@gmail.com \
    --cc=fink@mpe.mpg.de \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.