Re: [PATCH] Improve pci_alloc_consistent wrapper on preemptive kernels

From: Andrew Morton (akpm_at_osdl.org)
Date: 07/30/04

  • Next message: James Bottomley: "Re: [PATCH] Improve pci_alloc_consistent wrapper on preemptive kernels"
    Date:	Fri, 30 Jul 2004 13:20:16 -0700
    To: James Bottomley <James.Bottomley@HansenPartnership.com>
    
    

    James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
    >
    > On Fri, 2004-07-30 at 16:02, Andrew Morton wrote:
    > > We're paying for past sins here. I think it would be better to create a
    > > new version of pci_alloc_consistent() which takes gfp_flags, then migrate
    > > the drivers you care about to use it. That way the benefit is available on
    > > non-preempt kernels too.
    > >
    > > The ultimate aim of course would be to deprecate then remove the old
    > > function.
    >
    > True, that's why it was added for dma_alloc_coherent().
    >
    > Is there any need for a new wrapper? Why not just use
    > dma_alloc_coherent() from now on?
    >

    Sounds sane. But the default version in asm-generic/dma-mapping.h needs to
    be fixed up:

    static inline void *
    dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
                       int flag)
    {
            BUG_ON(dev->bus != &pci_bus_type);

            return pci_alloc_consistent(to_pci_dev(dev), size, dma_handle);
    }

    If we stick with this model, we'll still need a new pci_alloc_consistent_gfp().
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: James Bottomley: "Re: [PATCH] Improve pci_alloc_consistent wrapper on preemptive kernels"

    Relevant Pages

    • Re: [PATCH] Re: news about IDE PIO HIGHMEM bug (was: Re: 2.6.9-mm1)
      ... Hardware S/G tables just want to see a addr/len pair, ... of the drivers don't have to care about the VM-size details. ... Unfortunately those drivers that need need to do their own data transfer ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC&PATCH 1/2] PCI Error Recovery (readX_check)
      ... Yup, but then, the user have to take care that behind a single "error ... checking" entity, all devices have such drivers ... > It will have to depend on the bus setup. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: swsusp disk fails in bk-current - intel_agp at fault?
      ... >> after swsusp completes snapshotting memory. ... We really don't care about ... >> resume in drivers as is. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: Solving suspend-level confusion
      ... > with the exception of disk, for the few drivers that care... ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] Improve pci_alloc_consistent wrapper on preemptive kernels
      ... > We're paying for past sins here. ... > the drivers you care about to use it. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)