From: labbott@redhat.com (Laura Abbott)
To: linux-arm-kernel@lists.infradead.org
Subject: Having Linux handle different "types" of memory
Date: Wed, 22 Jul 2015 09:21:56 -0700 [thread overview]
Message-ID: <55AFC324.9010401@redhat.com> (raw)
In-Reply-To: <55AFB47B.301@free.fr>
On 07/22/2015 08:19 AM, Mason wrote:
> Hello everyone,
>
> I'm using an ARMv7 platform (Cortex A9) on Linux 3.14
>
> The system supports two memory modules.
>
> For performance reasons, memory is "transparently" interleaved
> (with a 128-byte grain). That is, when the CPU accesses addresses
> 0-127, it hits DRAM0; addresses 128-255, it hits DRAM1, and so on.
>
> The problem is that other devices in the system, mainly the
> Ethernet controller, didn't get the "transparent interleaving"
> treatment. They just see DRAM0 and DRAM1. And I'm guessing this
> will generate all kinds of "interesting" problems when I try to
> DMA from the Ethernet controller's memory to DRAM...
>
> Is there a way to tell Linux:
>
> 1) this 1GB memory chunk here is for you and your private allocations,
> but don't use it for talking to devices/peripherals.
>
> 2) this 1GB memory chunk there is for talking to devices/peripherals,
> but it has lower performance, so try not to use it for your own
> private memory pools, but you can if memory is /really/ tight.
>
> Is there something like this?
>
> Maybe one of the NUMA policies?
> https://www.kernel.org/doc/Documentation/vm/numa_memory_policy.txt
> (I don't see any arch/arm/mm/numa.c however)
>
> Maybe I can pretend that there is some kind of IOMMU?
> https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt
> arch/arm/include/asm/dma-iommu.h
>
> Or maybe there is an obvious solution that I'm missing?
>
I don't think there is an easy solution right now. This is still
an open problem as far as I know. You might look into whether
marking one of the regions as a CMA region would allow you the
control you need.
Thanks,
Laura
WARNING: multiple messages have this Message-ID (diff)
From: Laura Abbott <labbott@redhat.com>
To: Mason <slash.tmp@free.fr>,
Linux ARM <linux-arm-kernel@lists.infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: Having Linux handle different "types" of memory
Date: Wed, 22 Jul 2015 09:21:56 -0700 [thread overview]
Message-ID: <55AFC324.9010401@redhat.com> (raw)
In-Reply-To: <55AFB47B.301@free.fr>
On 07/22/2015 08:19 AM, Mason wrote:
> Hello everyone,
>
> I'm using an ARMv7 platform (Cortex A9) on Linux 3.14
>
> The system supports two memory modules.
>
> For performance reasons, memory is "transparently" interleaved
> (with a 128-byte grain). That is, when the CPU accesses addresses
> 0-127, it hits DRAM0; addresses 128-255, it hits DRAM1, and so on.
>
> The problem is that other devices in the system, mainly the
> Ethernet controller, didn't get the "transparent interleaving"
> treatment. They just see DRAM0 and DRAM1. And I'm guessing this
> will generate all kinds of "interesting" problems when I try to
> DMA from the Ethernet controller's memory to DRAM...
>
> Is there a way to tell Linux:
>
> 1) this 1GB memory chunk here is for you and your private allocations,
> but don't use it for talking to devices/peripherals.
>
> 2) this 1GB memory chunk there is for talking to devices/peripherals,
> but it has lower performance, so try not to use it for your own
> private memory pools, but you can if memory is /really/ tight.
>
> Is there something like this?
>
> Maybe one of the NUMA policies?
> https://www.kernel.org/doc/Documentation/vm/numa_memory_policy.txt
> (I don't see any arch/arm/mm/numa.c however)
>
> Maybe I can pretend that there is some kind of IOMMU?
> https://www.kernel.org/doc/Documentation/DMA-API-HOWTO.txt
> arch/arm/include/asm/dma-iommu.h
>
> Or maybe there is an obvious solution that I'm missing?
>
I don't think there is an easy solution right now. This is still
an open problem as far as I know. You might look into whether
marking one of the regions as a CMA region would allow you the
control you need.
Thanks,
Laura
next prev parent reply other threads:[~2015-07-22 16:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 15:19 Having Linux handle different "types" of memory Mason
2015-07-22 15:19 ` Mason
2015-07-22 16:21 ` Laura Abbott [this message]
2015-07-22 16:21 ` Laura Abbott
2015-07-22 20:20 ` Mason
2015-07-22 20:20 ` Mason
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=55AFC324.9010401@redhat.com \
--to=labbott@redhat.com \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.