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: akpm@zip.com.au, axboe@suse.de, linux-kernel@vger.kernel.org,
	martin@dalecki.de
Subject: Re: RFC: turn scatterlist into a linked list, eliminate bio_vec
Date: Tue, 25 Jun 2002 06:58:32 -0700 (PDT)	[thread overview]
Message-ID: <20020625.065832.105409446.davem@redhat.com> (raw)
In-Reply-To: <200206242044.NAA04851@adam.yggdrasil.com>

   From: "Adam J. Richter" <adam@yggdrasil.com>
   Date: Mon, 24 Jun 2002 13:44:25 -0700

       1. It would help to document if pci_pool_alloc(pool,SLAB_KERNEL,&dma)
          can ever return failure (as opposed to blocking forever).  That would
          effect whether certain error legs have to be written in a device
          driver.
   
Because a SLAB_KERNEL allocation can fail, thus can a pci_pool_alloc
allocation.  These rules have everything to do with what SLAB_KERNEL
means and there is nothing special about the fact that this flag is
being passed to pci_pool_alloc instead of kmalloc or similar.

       2. It sure would be nice if there were a couple of ifdef symbols
          that controlled the expansion DECLARE_PCI_UNMAP_{ADDR,LEN}, so
          that default usual implementations could be put in <linux/pci.h>,
          and so that it would be possible to portbly write sg_dma_address()
          that want to return sg.dma_addr if that field exists, and
          sg.vaddr otherwise.  This is of practical use because I would like
          to do the same thing for my proposed sglist.driver_priv{,_dma} fields.
   
Huh?  sg_dma_address() must return virt_to_bus() on non-IOMMU
platforms.  If it returned the virtual address that would be
a BUG().  Why do you want to change radically the semantics of
sg_dma_address() in such a radical way?  It makes no sense.

       3. Isn't the stuff about scatterlist->address obselete.  I thought that
          field was deleted in 2.5.
   
Yes, it should be killed, feel free to submit a patch.
   
   	Thanks for reminding me of them.  Although I had explored using
   them in another situation, I forgot about them for this situation, where
   they make sense, especially if pci_pool_alloc(...,SLAB_KERNEL,...) can
   never fail for lack of memory (although they could block indefinitely).
   I have updated my sample code accordingly.
   
SLAB_KERNEL can fail for pci_pool_alloc as it can fail for
kmalloc(...SLAB_KERNEL);  What makes you think that pci_pool_alloc
changes the well defined semantics of the SLAB_KERNEL flag?

   	Do you understand that scatterlist.driver_priv{,_dma} is just
   a follow-on optimization of my proposal to turn struct scatterlist
   into a linked list, so that pci_map_sg &co. can be consolidated into
   the "mid-level" drivers (scsi.o, usb.o)?
   
To be honest I think this is a horrible idea while we still lack
generic devices.  What about my SBUS scsi drivers, are they just sort
of "left out" of your infrastructure because it is PCI based?

Now is not the time for this, when we finally have the generic struct
device stuff, then you can start doing DMA stuff at the generic layer.
Until them you serve only to break things for non-PCI folks.

  reply	other threads:[~2002-06-25 14:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-24 20:44 RFC: turn scatterlist into a linked list, eliminate bio_vec Adam J. Richter
2002-06-25 13:58 ` David S. Miller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-25 21:27 Adam J. Richter
2002-06-25 14:35 Adam J. Richter
2002-06-24 11:42 Adam J. Richter
2002-06-24 12:39 ` David S. Miller
2002-06-23 23:58 Adam J. Richter
2002-06-24  6:24 ` David S. Miller
2002-06-24 19:29 ` William Lee Irwin III

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=20020625.065832.105409446.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=adam@yggdrasil.com \
    --cc=akpm@zip.com.au \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@dalecki.de \
    /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