public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steffen Persvold <sp@scali.com>
To: "David S. Miller" <davem@redhat.com>
Cc: adam@yggdrasil.com, linux-kernel@vger.kernel.org
Subject: Re: Does kmalloc always return address below 4GB?
Date: Tue, 05 Mar 2002 16:43:01 +0100	[thread overview]
Message-ID: <3C84E785.1D102FF9@scali.com> (raw)
In-Reply-To: <200203051112.DAA03159@adam.yggdrasil.com> <20020305.031636.63129004.davem@redhat.com>

"David S. Miller" wrote:
> 
>    From: "Adam J. Richter" <adam@yggdrasil.com>
>    Date: Tue, 5 Mar 2002 03:12:52 -0800
> 
>    If not, then I guess I can use
>    pci_alloc_consistent and pci_map_single as necessary, since they
>    should can potentially know that I am using a device that
>    only understands 32-bit addresses, from my earlier call to
>    pci_set_dma_mask.  However, I assume that it is considered
>    simpler and therefore better to avoid these routines when possible.
> 
> Just use pci_alloc_consistent, it never gives you
> anything larger than 32-bit addresses, please read the
> documentation :-)
> 

What about memory for streaming mappings. I know pci_map_single (and _sg) will
use bounce buffers on platforms without an IOMMU, but wouldn't it be nice if
this could also be ensured by the device driver to avoid uneccessary copying.
It could for example be solved with a GFP_32BIT flag or something (on IA64 I
know GFP_DMA is used in pci_alloc_consistent() to get memory below 4GB but that
can't be used on all platforms).


> On 64-bit platforms without CONFIG_HIGHMEM, kmalloc can return any
> pointer, but that is fine since your DMA mask will instruct the
> IOMMU layer of the platform to map it in the low 32-bits of DMA
> address space.
> 
> If you follow DMA-mapping.txt to the letter, it will just work, trust
> us. :-)

Regards,
-- 
  Steffen Persvold   | Scalable Linux Systems |   Try out the world's best
 mailto:sp@scali.com |  http://www.scali.com  | performing MPI implementation:
Tel: (+47) 2262 8950 |   Olaf Helsets vei 6   |      - ScaMPI 1.13.8 -
Fax: (+47) 2262 8951 |   N0621 Oslo, NORWAY   | >320MBytes/s and <4uS latency

  reply	other threads:[~2002-03-05 15:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-05 11:12 Does kmalloc always return address below 4GB? Adam J. Richter
2002-03-05 11:16 ` David S. Miller
2002-03-05 15:43   ` Steffen Persvold [this message]
2002-03-05 15:47     ` David S. Miller
2002-03-05 16:44       ` David Mosberger
2002-03-06  1:09         ` David S. Miller
2002-03-06  1:31           ` David Mosberger
2002-03-06  1:52             ` David S. Miller
2002-03-06  2:04               ` David Mosberger
  -- strict thread matches above, loose matches on Subject: below --
2002-03-05 11:52 Adam J. Richter
2002-03-05 11:59 ` David S. Miller
2002-03-05 14:43 Adam J. Richter
2002-03-05 15:15 ` David S. Miller
2002-03-05 16:39 Adam J. Richter
2002-03-05 17:00 ` Gerd Knorr
2002-03-06  7:22   ` David S. Miller
2002-03-05 21:57 ` Steffen Persvold
2002-03-05 17:08 Adam J. Richter
2002-03-06  1:13 ` David S. Miller
2002-03-06  2:28 Adam J. Richter

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=3C84E785.1D102FF9@scali.com \
    --to=sp@scali.com \
    --cc=adam@yggdrasil.com \
    --cc=davem@redhat.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