public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: adam@yggdrasil.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Does pci_alloc_consisent really need to zero memory?
Date: Thu, 30 May 2002 04:30:49 -0700 (PDT)	[thread overview]
Message-ID: <20020530.043049.63270720.davem@redhat.com> (raw)
In-Reply-To: <200205301141.EAA15864@baldur.yggdrasil.com>

   From: "Adam J. Richter" <adam@yggdrasil.com>
   Date: Thu, 30 May 2002 04:41:06 -0700

   	In my efforts to port almost all of the scsi drivers to your
   DMA-mapping interface, I have converted some kmalloc's that
   are frequently called with pci_alloc_consistent (I have not
   submitted these changes, because I think there is an unrelated
   bug in my changes).  Come to think of it, you advised me to go
   that route, as opposed to using pci_map_single(), when I asked about
   it with respect to advansys.c.  I'd like to have as little
   performance penalty for this as possible.  That also makes it
   marginally easier to encourge movement to your DMA-mapping interface.
   
The only advansys.c should be using consistent memory for are
it's command descriptor blocks that it sends to/from the card.
It should allocate these at device probe time, not while SCSI
commands are being issued.

Maybe for rare things like scsi status blocks, but not for normal scsi
command blocks.  Therein lies your problem, nothing to do with
pci_alloc_consistent zero'ing out memory or not.

   	While it is normally good programming practice for
   routines to always return deterministic results (same initial
   values in memory), I think that in a performance-oriented
   software component like the kernel, it's better programming practice
   to have primitives that do no more than they need to, that run as
   fast as possible, and behave consistently (no other remaining memory
   allocators in linux-2.5 do this, right?).
   
pci_alloc_consistent is not defined to go fast, period.  This allows
considerable flexibility in implementation.  On several systems,
setting up consistent mappings are expensive.  There is simply no way
around it.  But that's ok if the drivers aren't using it in hot paths,
which as I describe above they should not.

So trying to "speed up" pci_alloc_consistent is a misguided adventure.

Franks a lot,
David S. Miller
davem@redhat.com

  reply	other threads:[~2002-05-30 11:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-30 11:41 Does pci_alloc_consisent really need to zero memory? Adam J. Richter
2002-05-30 11:30 ` David S. Miller [this message]
2002-06-03 16:45 ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2002-05-30  9:11 Adam J. Richter
2002-05-30  9:49 ` David S. Miller
2002-05-30 11:05   ` Emmanuel Michon
2002-05-30 10:54     ` David S. Miller

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=20020530.043049.63270720.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=adam@yggdrasil.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox