All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>,
	Zhao Gongyi <zhaogongyi@bytedance.com>
Cc: will@kernel.org, Ryan Roberts <Ryan.Roberts@arm.com>,
	dev.jain@arm.com, baolin.wang@linux.alibaba.com,
	lance.yang@linux.dev, mark.rutland@arm.com,
	akpm@linux-foundation.org, ljs@kernel.org, liam@infradead.org,
	vbabka@kernel.org, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, linux-arm-kernel@lists.infradead.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] arm64/mm: restrict transparent contpte mappings to valid PTEs
Date: Mon, 26 Oct 2026 23:33:31 +0100	[thread overview]
Message-ID: <c267c29a-5678-4c0f-a15d-e5c12ae8c427@kernel.org> (raw)
In-Reply-To: <at9H9Vkx57pIcPos@arm.com>

On 10/26/26 13:30, Catalin Marinas wrote:
> On Sun, Oct 25, 2026 at 12:00:33AM +0800, Zhao Gongyi wrote:
>> On 10/24/26 4:55 AM, David Hildenbrand (Arm) wrote:
>>> If we have the spare PTE bit, why shouldn't we just use it?
>>>
>>> It will make batching over PTEs faster. And we care about that for present PTEs.
>>>
>>> So I don't quite see why the stable fix couldn't just do it right away? Do you
>>> have a prototype that shows that it would require significant code changes?
>>
>> I tried a small prototype that keeps PTE_CONT on present-invalid PTEs.
>> It leaves contpte_set_ptes() unchanged and makes contpte_try_unfold()
>> recognize pte_present(pte) && pte_cont(pte), instead of checking only
>> pte_valid_cont(pte).
> 
> I think it's worth doing but currently not sure it buys us much unless
> we also change pte_batch_hint() to cover such entries. However, if we do
> this, we need to audit the other pte_valid_cont() callers (e.g.
> ptep_get() needs updating as well).
> 
> So, if we aren't going to change pte_batch_hint() as a backport fix (I
> don't think we should, it's an optimisation), I'd rather take v2 now and
> continue with a proper pte_present_cont() etc. patchset on top.

Your call, the version actually looks quite clean:

https://lore.kernel.org/r/52e7e1f6-3535-474d-9b46-6bb62f96eefc@bytedance.com

But yeah, audit needed (e.g., no need to flush when shattering such entries that
are not valid)

-- 
Cheers,

David


  reply	other threads:[~2026-10-26 23:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13  9:36 [PATCH] arm64/mm: restrict transparent contpte mappings to valid PTEs Zhao Gongyi
2026-10-13 10:13 ` Dev Jain
2026-10-14  6:16   ` Zhao Gongyi
2026-10-13 15:39 ` Lance Yang
2026-10-14  6:31   ` Zhao Gongyi
2026-10-14  6:46     ` Lance Yang
2026-10-14  8:38       ` Baolin Wang
2026-10-14  9:24         ` Lance Yang
2026-10-14  9:35           ` Baolin Wang
2026-10-14 10:03     ` Dev Jain
2026-10-14 10:45       ` Lance Yang
2026-10-14 11:02         ` Dev Jain
2026-10-14  9:41 ` David Hildenbrand (Arm)
2026-10-19  7:06   ` Zhao Gongyi
2026-10-23 20:55     ` David Hildenbrand (Arm)
2026-10-24 16:00       ` Zhao Gongyi
2026-10-25 12:34         ` David Hildenbrand (Arm)
2026-10-26 13:30           ` Zhao Gongyi
2026-10-26 12:30         ` Catalin Marinas
2026-10-26 22:33           ` David Hildenbrand (Arm) [this message]
2026-10-27 16:49             ` Catalin Marinas
2026-10-23 12:12 ` [PATCH v2] " Zhao Gongyi
2026-10-29 17:23   ` Catalin Marinas

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=c267c29a-5678-4c0f-a15d-e5c12ae8c427@kernel.org \
    --to=david@kernel.org \
    --cc=Ryan.Roberts@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=catalin.marinas@arm.com \
    --cc=dev.jain@arm.com \
    --cc=lance.yang@linux.dev \
    --cc=liam@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=will@kernel.org \
    --cc=zhaogongyi@bytedance.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 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.