mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Magnus Lindholm <linmag7@gmail.com>
To: richard.henderson@linaro.org, mattst88@gmail.com,
	linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org
Cc: linmag7@gmail.com
Subject: [PATCH v2 0/2] alpha: enable DMA CMA support
Date: Sat, 14 Nov 2026 10:53:15 +0100	[thread overview]
Message-ID: <20261114095335.1283016-1-linmag7@gmail.com> (raw)

This revision addresses Matt Turner's review of the original CMA patch.

Split early parameter parsing into a prerequisite patch. Use the generic
DMA contiguous allocation/free helpers, skip CMA on the GFP_DMA retry,
and use exact-size buddy allocations to match current helper semantics.
Remove the redundant highmem check and preserve existing zeroing.

Reserve top-down below the direct-map window and usable RAM limits.
This avoids preferentially taking low memory with bottom-up allocation;
it is not a strict exclusion of the first 16 MiB. Explicit cma= address
ranges retain the generic override semantics. If there is no direct-map
window, skip the default reservation.

The configured default is 16 MiB; cma=0 disables the default reservation.

These two patches apply independently on for-next at 0b4cadbe7c39.
The ES40 test kernel additionally contains jump-label v3. The combined
kernel, boot image and modules cross-build with W=1. Both CMA patches
pass checkpatch with no warnings or errors.

CMA testing on a three-CPU AlphaServer ES40 with cma=64M:

  - Reserved 64 MiB at 0x7c000000, above the first 16 MiB and below
    the 2 GiB direct-map limit.
  - Ran four allocation cases on each CPU (12 cases total).
  - 32 MiB and 24 KiB (three-page) GFP_KERNEL allocations used CMA.
  - 8 KiB (one-page) GFP_KERNEL and 24 KiB GFP_ATOMIC allocations
    bypassed CMA.
  - All buffers passed zeroing and CPU write/read checks.
  - CMA allocation/release counters balanced, and available_pages
    returned to its pre-test value after each allocation was freed.

The initial harness compared CmaFree immediately after freeing a small
allocation. That was not a reliable per-allocation check; verification
using the CMA sysfs counters confirmed that all test pages were released.

No new kernel warnings or faults appeared during testing. These tests
exercise coherent allocation and freeing, not device-initiated DMA.
GFP_ATOMIC was tested from process context. Boots with cma=0, cma=4M
and the default size, fragmentation stress, and no-IOMMU platform
validation remain outstanding.

Link to v1:
https://lore.kernel.org/linux-alpha/20260219205514.4434-1-linmag7@gmail.com/

Magnus Lindholm (2):
  alpha: parse early parameters before reserving contiguous memory
  alpha: enable contiguous memory allocation for coherent DMA

 .../io/dma-contiguous/arch-support.txt         |  2 +-
 arch/alpha/Kconfig                             |  1 +
 arch/alpha/kernel/pci_iommu.c                  | 13 +++++++++----
 arch/alpha/kernel/setup.c                      | 18 ++++++++++++++++++
 4 files changed, 29 insertions(+), 5 deletions(-)


base-commit: 0b4cadbe7c39d830dec35c4a2655483de0dae568
-- 
2.43.0


             reply	other threads:[~2026-11-14  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14  9:53 Magnus Lindholm [this message]
2026-11-14  9:53 ` [PATCH v2 1/2] alpha: parse early parameters before reserving contiguous memory Magnus Lindholm
2026-11-14  9:53 ` [PATCH v2 2/2] alpha: enable contiguous memory allocation for coherent DMA Magnus Lindholm

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=20261114095335.1283016-1-linmag7@gmail.com \
    --to=linmag7@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattst88@gmail.com \
    --cc=richard.henderson@linaro.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

all inboxes | Powered by JetHome®