Linux Test Project
 help / color / mirror / Atom feed
From: Wake Liu via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Cc: kaleshsingh@google.com
Subject: [LTP] [PATCH 0/2] msync04, pipe2_04: Support kernel/userspace page size mismatch
Date: Mon, 16 Nov 2026 07:23:44 +0000	[thread overview]
Message-ID: <20261116072346.2462510-1-wakel@google.com> (raw)

Hi,

This is the follow-up to the earlier series [1] for running LTP under
the 16K page size emulation of the Android Common Kernels [2]
(page_shift=14 on the kernel command line on x86_64), where the kernel
reports a 16K page size to userspace while keeping 4K pages internally.

These two patches were kept separate from [1] because they adjust how
msync04 and pipe2_04 verify the tested behavior:

- msync04: under the emulation, each /proc/self/pagemap entry covers
  four 4K kernel pages and therefore exposes no PFN (PFN == 0 even for
  root), so the test falls back to TCONF. When PM_PRESENT is set and
  PFN is 0, check Shared_Dirty and Private_Dirty of the mapping in
  /proc/self/smaps instead. Nothing changes on kernels that expose the
  PFN to root.
- pipe2_04: F_SETPIPE_SZ(0) rounds the capacity up to one pipe buffer
  (one 4K kernel page), so checking that F_GETPIPE_SZ on the other end
  matches the size returned by F_SETPIPE_SZ and does not exceed
  getpagesize() preserves the cross-fd check without assuming a pipe
  buffer is getpagesize() bytes.

Tested on:
- x86_64 with a 4K page size (Debian, 7.1 kernel), where pipe2_04
  passes and both tests compile without warnings with gcc and clang.
- An Android x86_64 emulator with a 4K page size (6.6 kernel), where
  both tests pass before and after.
- An Android x86_64 Cuttlefish device running 6.18.32-android17 with
  page_shift=14, where msync04 goes from 4x TCONF to 4x TPASS and
  pipe2_04 goes from TFAIL to TPASS.

[1] https://lore.kernel.org/ltp/20261111093151.374731-1-wakel@google.com/
[2] https://source.android.com/docs/core/architecture/16kb-page-size/getting-started-cf-x86-64-pgagnostic

Wake Liu (2):
  msync04: Check smaps when the page frame number is not exposed
  pipe2_04: Don't assume the minimum pipe size is getpagesize()

 testcases/kernel/syscalls/msync/msync04.c  | 46 +++++++++++++++++++++-
 testcases/kernel/syscalls/pipe2/pipe2_04.c | 17 +++++---
 2 files changed, 56 insertions(+), 7 deletions(-)


base-commit: 686a331b6240e54ac3170717adfd28ec94cfe100
-- 
2.56.0.611.g1030f0b940-goog


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2026-11-16  7:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  7:23 Wake Liu via ltp [this message]
2026-11-16  7:23 ` [LTP] [PATCH 1/2] msync04: Check smaps when the page frame number is not exposed Wake Liu via ltp
2026-11-16 12:09   ` [LTP] " linuxtestproject.agent
2026-11-16  7:23 ` [LTP] [PATCH 2/2] pipe2_04: Don't assume the minimum pipe size is getpagesize() Wake Liu via ltp
2026-11-16 14:22 ` [LTP] [PATCH v2 0/2] msync04, pipe2_04: Support kernel/userspace page size mismatch Wake Liu via ltp
2026-11-16 14:22   ` [LTP] [PATCH v2 1/2] msync04: Check smaps when the page frame number is not exposed Wake Liu via ltp
2026-11-16 22:35     ` [LTP] " linuxtestproject.agent
2026-11-16 14:22   ` [LTP] [PATCH v2 2/2] pipe2_04: Don't assume the minimum pipe size is getpagesize() Wake Liu via ltp
2026-11-24  8:42   ` [LTP] [PATCH v2 0/2] msync04, pipe2_04: Support kernel/userspace page size mismatch Wake Liu via ltp

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=20261116072346.2462510-1-wakel@google.com \
    --to=ltp@lists.linux.it \
    --cc=kaleshsingh@google.com \
    --cc=wakel@google.com \
    /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