All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tianyi Chen <hi@tychen.cc>
To: Mike Rapoport <rppt@kernel.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, hi@tychen.cc
Subject: [PATCH v3 0/2] memblock tests: cover low-address allocations
Date: Thu, 10 Sep 2026 07:55:22 +0800	[thread overview]
Message-ID: <cover.1788997523.git.hi@tychen.cc> (raw)

Model a low allocation limit within the memory registered by the simulator,
then exercise memblock_alloc_low() in both allocation directions.

Changes in v3:
- Describe the low limit and simulated RAM alignment directly in comments
  and README.
- Use Assisted-by: LLM in both patches.
- Start a separate thread for this revision.

The pointer casts remain unchanged. With BUILD=32, pointers are 32-bit and
phys_addr_t is 64-bit: the tested compiler sign-extends a direct cast, while
the conversion through uintptr_t zero-extends it. The direct casts also
introduce compiler warnings, so this revision preserves the existing
conversion behavior. There are no executable code changes from v2.

Validation with ASan and UBSan enabled:
- Default and 32BIT_PHYS_ADDR_T=1: 189 tests pass in each runtime mode.
- NUMA=1, 32BIT_PHYS_ADDR_T=1 with NUMA=1, and MEMBLOCK_DEBUG=1 with NUMA=1:
  272 tests pass in each runtime mode.
- Both ./main -v and ./main -v -m were run for those configurations.
- BUILD=32 builds without warnings from alloc_low_api.c. Its runtime still
  hits the pre-existing basic_api.c memblock_free_near_max_check assertion
  before reaching the low-allocation tests.

v2: https://lore.kernel.org/r/178874362959.1415955.18132997964995947947.memblock-v2-0@tychen.cc

Tianyi Chen (2):
  memblock tests: model the low allocation limit within dummy memory
  memblock tests: cover allocations below the low address limit

 tools/testing/memblock/Makefile              |   3 +-
 tools/testing/memblock/README                |  12 +-
 tools/testing/memblock/TODO                  |   5 -
 tools/testing/memblock/asm/dma.h             |   6 +
 tools/testing/memblock/main.c                |   2 +
 tools/testing/memblock/tests/alloc_low_api.c | 148 +++++++++++++++++++
 tools/testing/memblock/tests/alloc_low_api.h |   9 ++
 tools/testing/memblock/tests/common.c        |   6 +
 8 files changed, 178 insertions(+), 13 deletions(-)
 delete mode 100644 tools/testing/memblock/TODO
 create mode 100644 tools/testing/memblock/tests/alloc_low_api.c
 create mode 100644 tools/testing/memblock/tests/alloc_low_api.h

-- 
2.55.0


             reply	other threads:[~2026-09-09 23:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 23:55 Tianyi Chen [this message]
2026-09-09 23:55 ` [PATCH v3 1/2] memblock tests: model the low allocation limit within dummy memory Tianyi Chen
2026-09-09 23:55 ` [PATCH v3 2/2] memblock tests: cover allocations below the low address limit Tianyi Chen
2026-09-10  9:58 ` [PATCH v3 0/2] memblock tests: cover low-address allocations Mike Rapoport

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=cover.1788997523.git.hi@tychen.cc \
    --to=hi@tychen.cc \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@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 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.