From: Marin Mitov <mitov@issp.bas.bg>
To: Grant Grundler <grundler@google.com>
Cc: Mikael Pettersson <mikpe@it.uu.se>,
linux-kernel@vger.kernel.org, Jeff Garzik <jgarzik@pobox.com>,
linux-ide@vger.kernel.org
Subject: Re: [PATCH] pci_try_set_mwi() in sata_promise
Date: Wed, 23 Apr 2008 21:15:32 +0300 [thread overview]
Message-ID: <200804232115.33080.mitov@issp.bas.bg> (raw)
In-Reply-To: <da824cf30804230746o74e8de0bxbcb31d4b13e98b6@mail.gmail.com>
On Wednesday 23 April 2008 05:46:49 pm Grant Grundler wrote:
> On Wed, Apr 23, 2008 at 6:33 AM, Marin Mitov <mitov@issp.bas.bg> wrote:
> ...
> > > 2. What improvement does that pci_try_set_mwi() cause? Speed? Fewer errors?
> >
> > May be speed, but practically hardly observable.
>
> I expect the difference to be in available memory BW.
> MWI (Memory Write Invalidate) allows the IO controller to write
> partial cachlines without having to do a read/modify/write sequence.
My understanding of MWI is different. It concerns full cache line writes.
In that case the CPU can invalidate the cache line (without flushing it to
RAM). While in case of partial cache line writes, the processor should
flush the cache line before the controller writes to corresponding cached
address and then the controller finishes its partial cache line write to RAM.
In case MWI is NOT enables the CPU should flushe every cache line touched
by the controller's DMA machine, nevertheless it will be overwritten latter.
But, as usual, I could be wrong :-)
> R/W/M means the cacheline has to cross the memory bus twice.
> The difference in performance will depend on how often the
> Promise SATA controller was doing partial cachline
> transactions with the wrong cacheline size.
>
> This should be measurable if you run a memory test at the same time
> as you stress the SATA controller with fio. Re-read the same 128KB block
> repeatedly from the Promise controller (I'm expecting that to be cached)
> and measure the available memory BW (e.g. see lmbench for a memtest).
> Repeat with MWI enabled.
>
>
> > > 3. Why call pci_try_set_mwi()? Can't you set the cache line size directly?
> >
> > pci_set_cacheline_size() is NOT exported, while pci_try_set_mwi() IS and
> > sets (as a side effect) the cache line size.
>
> Setting the cachline size only makes sense if MWI is enabled.
Agreed.
> Drivers should not longer directly set the cacheline size since it might
> not be what they think it is.
That is the reason why pci_set_mwi() and pci_try_set_mwi() exist.
Marin Mitov
>
> hth,
> grant
>
prev parent reply other threads:[~2008-04-23 18:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-22 18:26 [PATCH] pci_try_set_mwi() in sata_promise Marin Mitov
2008-04-23 7:57 ` Mikael Pettersson
2008-04-23 12:31 ` Marin Mitov
2008-04-23 12:34 ` Marin Mitov
2008-04-23 13:33 ` Marin Mitov
2008-04-23 14:46 ` Grant Grundler
2008-04-23 18:15 ` Marin Mitov [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=200804232115.33080.mitov@issp.bas.bg \
--to=mitov@issp.bas.bg \
--cc=grundler@google.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@it.uu.se \
/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).