mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Zenghui Yu <zenghui.yu@linux.dev>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	akpm@linux-foundation.org, rppt@kernel.org, peterx@redhat.com,
	ljs@kernel.org, liam@infradead.org, vbabka@kernel.org,
	surenb@google.com, mhocko@suse.com
Subject: Re: [PATCH] selftests/mm: fix uffd move-pmd test crash on 64K base page systems
Date: Thu, 29 Oct 2026 16:47:31 +0100	[thread overview]
Message-ID: <bf163c58-a884-4164-bede-974b78f032b3@kernel.org> (raw)
In-Reply-To: <2162e5c9-58f4-427f-984d-0099d9b515fc@linux.dev>

On 10/29/26 14:37, Zenghui Yu wrote:
> Hi David,
> 
> On 10/13/26 3:39 PM, David Hildenbrand (Arm) wrote:
>> On 10/11/26 18:35, Zenghui Yu wrote:
>>> From: "Zenghui Yu (Huawei)" <zenghui.yu@linux.dev>
>>>
>>> uffd_move_pmd_test()/uffd_move_test_common() splits the test area into
>>> chunks of chunk_size and moves them one by one.  On arm64 with 64K base
>>> pages the chunk_size (read_pmd_pagesize()) is 512MB, which is larger than
>>> the whole 32MB (UFFD_TEST_MEM_SIZE) test area:
>>>
>>>   step_count = nr_pages / (chunk_size / page_size) == 0
>>>
>>> Because chunk_size > page_size, the test then aligns both areas up to
>>> 512MB, which points far outside of the 32MB mappings, and decrements
>>> step_count, which underflows to ULONG_MAX.  The verification loop then
>>> runs away and the first dereference of area_src faults with a SIGSEGV.
>>>
>>> Skip the test when a single chunk cannot fit into the test area.
>>
>> That leaves 64k untested, though? Why not adjust the chunk size accordingly?
> 
> Right. Apparently this has never been tested on 64k :)

Yeah. And if we start supporting it we should properly test it :)

> 
> I agree that scaling the chunk size is the better approach -- it gives us
> actual test coverage on such configuration, instead of bailing out early.
> 
> If anyone is interested in it, please feel free to send a patch. Otherwise
> I'll work on it when I get some spare time.
I guess no rush on this one.

-- 
Cheers,

David

      reply	other threads:[~2026-10-29 15:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 16:35 Zenghui Yu
2026-10-12  6:13 ` Sarthak Sharma
2026-10-29 13:10   ` Zenghui Yu
2026-10-12 12:12 ` Jose A. Perez de Azpillaga
2026-10-13  7:39 ` David Hildenbrand (Arm)
2026-10-13 10:33   ` Mike Rapoport
2026-10-13 11:46     ` David Hildenbrand (Arm)
2026-10-29 13:37   ` Zenghui Yu
2026-10-29 15:47     ` David Hildenbrand (Arm) [this message]

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=bf163c58-a884-4164-bede-974b78f032b3@kernel.org \
    --to=david@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=liam@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=peterx@redhat.com \
    --cc=rppt@kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=zenghui.yu@linux.dev \
    /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®