linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Mark Lord <liml@rtr.ca>
Cc: Andreas Mohr <andi@lisas.de>, linux-ide@vger.kernel.org
Subject: Re: linux/libata.h/ata_busy_wait() inefficiencies?
Date: Wed, 26 Mar 2008 21:34:58 +0000	[thread overview]
Message-ID: <20080326213458.5a391c00@core> (raw)
In-Reply-To: <47EA5999.2010500@rtr.ca>

> > Those two tweaks alone may already be able to deliver a noticeable speedup
> > of ata operations given that this is frequently used inner libata code.
> ..

Unlikely given the fact that chk_status will be a synchronous I/O request
across the bus and on many controllers across to the device itself. Any
other optimisations get a bit irrelevant

> While you're at it, the udelay(10) should really be *much* smaller,
> or at least broken into a top/bottom pair of udelay(5).  I really suspect
> that much of the time, the status value is satisified on the first iteration,
> requiring no more than a microsecond or so.  Yet we always force it to take
> at least 10us, or about 15000 instructions worth on a modern CPU.

That depends how long after the event before the wait_for_ is called
must elapse before the status bits are valid. There is also a trade off
of bus usage - especially on older devices where we will lock the bus and
thus CPU for maybe 1-2uS *per* chk_status.

If you want performance get an AHCI controller 8)

Alan

      reply	other threads:[~2008-03-26 21:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 20:59 linux/libata.h/ata_busy_wait() inefficiencies? Andreas Mohr
2008-03-26 14:11 ` Mark Lord
2008-03-26 21:34   ` Alan Cox [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=20080326213458.5a391c00@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=andi@lisas.de \
    --cc=liml@rtr.ca \
    --cc=linux-ide@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 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).