All of lore.kernel.org
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	x86@kernel.org, David Hildenbrand <david@redhat.com>,
	Yang Shi <shy828301@gmail.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-mm@kvack.org, Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Will Deacon <will@kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>, Marc Zyngier <maz@kernel.org>,
	Alistair Popple <apopple@nvidia.com>,
	Barry Song <21cnbao@gmail.com>,
	Matthew Wilcox <willy@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, Zi Yan <ziy@nvidia.com>,
	John Hubbard <jhubbard@nvidia.com>,
	Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, James Morse <james.morse@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v6 18/18] arm64/mm: Automatically fold contpte mappings
Date: Fri, 16 Feb 2024 12:35:03 +0000	[thread overview]
Message-ID: <Zc9Wd0N03pPY5Nq5@arm.com> (raw)
In-Reply-To: <20240215103205.2607016-19-ryan.roberts@arm.com>

On Thu, Feb 15, 2024 at 10:32:05AM +0000, Ryan Roberts wrote:
> There are situations where a change to a single PTE could cause the
> contpte block in which it resides to become foldable (i.e. could be
> repainted with the contiguous bit). Such situations arise, for example,
> when user space temporarily changes protections, via mprotect, for
> individual pages, such can be the case for certain garbage collectors.
> 
> We would like to detect when such a PTE change occurs. However this can
> be expensive due to the amount of checking required. Therefore only
> perform the checks when an indiviual PTE is modified via mprotect
> (ptep_modify_prot_commit() -> set_pte_at() -> set_ptes(nr=1)) and only
> when we are setting the final PTE in a contpte-aligned block.
> 
> Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Will Deacon <will@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	David Hildenbrand <david@redhat.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	John Hubbard <jhubbard@nvidia.com>, Zi Yan <ziy@nvidia.com>,
	Barry Song <21cnbao@gmail.com>,
	Alistair Popple <apopple@nvidia.com>,
	Yang Shi <shy828301@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-arm-kernel@lists.infradead.org, x86@kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 18/18] arm64/mm: Automatically fold contpte mappings
Date: Fri, 16 Feb 2024 12:35:03 +0000	[thread overview]
Message-ID: <Zc9Wd0N03pPY5Nq5@arm.com> (raw)
In-Reply-To: <20240215103205.2607016-19-ryan.roberts@arm.com>

On Thu, Feb 15, 2024 at 10:32:05AM +0000, Ryan Roberts wrote:
> There are situations where a change to a single PTE could cause the
> contpte block in which it resides to become foldable (i.e. could be
> repainted with the contiguous bit). Such situations arise, for example,
> when user space temporarily changes protections, via mprotect, for
> individual pages, such can be the case for certain garbage collectors.
> 
> We would like to detect when such a PTE change occurs. However this can
> be expensive due to the amount of checking required. Therefore only
> perform the checks when an indiviual PTE is modified via mprotect
> (ptep_modify_prot_commit() -> set_pte_at() -> set_ptes(nr=1)) and only
> when we are setting the final PTE in a contpte-aligned block.
> 
> Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Catalin Marinas <catalin.marinas@arm.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Will Deacon <will@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Matthew Wilcox <willy@infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	David Hildenbrand <david@redhat.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	John Hubbard <jhubbard@nvidia.com>, Zi Yan <ziy@nvidia.com>,
	Barry Song <21cnbao@gmail.com>,
	Alistair Popple <apopple@nvidia.com>,
	Yang Shi <shy828301@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-arm-kernel@lists.infradead.org, x86@kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 18/18] arm64/mm: Automatically fold contpte mappings
Date: Fri, 16 Feb 2024 12:35:03 +0000	[thread overview]
Message-ID: <Zc9Wd0N03pPY5Nq5@arm.com> (raw)
In-Reply-To: <20240215103205.2607016-19-ryan.roberts@arm.com>

On Thu, Feb 15, 2024 at 10:32:05AM +0000, Ryan Roberts wrote:
> There are situations where a change to a single PTE could cause the
> contpte block in which it resides to become foldable (i.e. could be
> repainted with the contiguous bit). Such situations arise, for example,
> when user space temporarily changes protections, via mprotect, for
> individual pages, such can be the case for certain garbage collectors.
> 
> We would like to detect when such a PTE change occurs. However this can
> be expensive due to the amount of checking required. Therefore only
> perform the checks when an indiviual PTE is modified via mprotect
> (ptep_modify_prot_commit() -> set_pte_at() -> set_ptes(nr=1)) and only
> when we are setting the final PTE in a contpte-aligned block.
> 
> Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>


  parent reply	other threads:[~2024-02-16 12:35 UTC|newest]

Thread overview: 180+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 10:31 [PATCH v6 00/18] Transparent Contiguous PTEs for User Mappings Ryan Roberts
2024-02-15 10:31 ` Ryan Roberts
2024-02-15 10:31 ` Ryan Roberts
2024-02-15 10:31 ` [PATCH v6 01/18] mm: Clarify the spec for set_ptes() Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31 ` [PATCH v6 02/18] mm: thp: Batch-collapse PMD with set_ptes() Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31 ` [PATCH v6 03/18] mm: Introduce pte_advance_pfn() and use for pte_next_pfn() Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:40   ` David Hildenbrand
2024-02-15 10:40     ` David Hildenbrand
2024-02-15 10:40     ` David Hildenbrand
2024-02-15 10:31 ` [PATCH v6 04/18] arm64/mm: Convert pte_next_pfn() to pte_advance_pfn() Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:42   ` David Hildenbrand
2024-02-15 10:42     ` David Hildenbrand
2024-02-15 10:42     ` David Hildenbrand
2024-02-15 11:17   ` Mark Rutland
2024-02-15 11:17     ` Mark Rutland
2024-02-15 11:17     ` Mark Rutland
2024-02-15 18:27   ` Catalin Marinas
2024-02-15 18:27     ` Catalin Marinas
2024-02-15 18:27     ` Catalin Marinas
2024-02-15 10:31 ` [PATCH v6 05/18] x86/mm: " Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:43   ` David Hildenbrand
2024-02-15 10:43     ` David Hildenbrand
2024-02-15 10:43     ` David Hildenbrand
2024-02-15 10:31 ` [PATCH v6 06/18] mm: Tidy up pte_next_pfn() definition Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:43   ` David Hildenbrand
2024-02-15 10:43     ` David Hildenbrand
2024-02-15 10:43     ` David Hildenbrand
2024-02-15 10:31 ` [PATCH v6 07/18] arm64/mm: Convert READ_ONCE(*ptep) to ptep_get(ptep) Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 11:18   ` Mark Rutland
2024-02-15 11:18     ` Mark Rutland
2024-02-15 11:18     ` Mark Rutland
2024-02-15 18:34   ` Catalin Marinas
2024-02-15 18:34     ` Catalin Marinas
2024-02-15 18:34     ` Catalin Marinas
2024-02-15 10:31 ` [PATCH v6 08/18] arm64/mm: Convert set_pte_at() to set_ptes(..., 1) Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 11:19   ` Mark Rutland
2024-02-15 11:19     ` Mark Rutland
2024-02-15 11:19     ` Mark Rutland
2024-02-15 18:34   ` Catalin Marinas
2024-02-15 18:34     ` Catalin Marinas
2024-02-15 18:34     ` Catalin Marinas
2024-02-15 10:31 ` [PATCH v6 09/18] arm64/mm: Convert ptep_clear() to ptep_get_and_clear() Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 11:20   ` Mark Rutland
2024-02-15 11:20     ` Mark Rutland
2024-02-15 11:20     ` Mark Rutland
2024-02-15 18:35   ` Catalin Marinas
2024-02-15 18:35     ` Catalin Marinas
2024-02-15 18:35     ` Catalin Marinas
2024-02-15 10:31 ` [PATCH v6 10/18] arm64/mm: New ptep layer to manage contig bit Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 11:23   ` Mark Rutland
2024-02-15 11:23     ` Mark Rutland
2024-02-15 11:23     ` Mark Rutland
2024-02-15 19:21   ` Catalin Marinas
2024-02-15 19:21     ` Catalin Marinas
2024-02-15 19:21     ` Catalin Marinas
2024-02-15 10:31 ` [PATCH v6 11/18] arm64/mm: Split __flush_tlb_range() to elide trailing DSB Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 11:24   ` Mark Rutland
2024-02-15 11:24     ` Mark Rutland
2024-02-15 11:24     ` Mark Rutland
2024-02-15 19:22   ` Catalin Marinas
2024-02-15 19:22     ` Catalin Marinas
2024-02-15 19:22     ` Catalin Marinas
2024-02-15 10:31 ` [PATCH v6 12/18] arm64/mm: Wire up PTE_CONT for user mappings Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 10:31   ` Ryan Roberts
2024-02-15 11:27   ` Mark Rutland
2024-02-15 11:27     ` Mark Rutland
2024-02-15 11:27     ` Mark Rutland
2024-02-16 12:25   ` Catalin Marinas
2024-02-16 12:25     ` Catalin Marinas
2024-02-16 12:25     ` Catalin Marinas
2024-02-16 12:53     ` Ryan Roberts
2024-02-16 12:53       ` Ryan Roberts
2024-02-16 12:53       ` Ryan Roberts
2024-02-16 16:56       ` Catalin Marinas
2024-02-16 16:56         ` Catalin Marinas
2024-02-16 16:56         ` Catalin Marinas
2024-02-16 19:54         ` John Hubbard
2024-02-16 19:54           ` John Hubbard
2024-02-16 19:54           ` John Hubbard
2024-02-20 19:50           ` Ryan Roberts
2024-02-20 19:50             ` Ryan Roberts
2024-02-20 19:50             ` Ryan Roberts
2024-02-19 15:18       ` Catalin Marinas
2024-02-19 15:18         ` Catalin Marinas
2024-02-19 15:18         ` Catalin Marinas
2024-02-20 19:58         ` Ryan Roberts
2024-02-20 19:58           ` Ryan Roberts
2024-02-20 19:58           ` Ryan Roberts
2024-02-15 10:32 ` [PATCH v6 13/18] arm64/mm: Implement new wrprotect_ptes() batch API Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 11:28   ` Mark Rutland
2024-02-15 11:28     ` Mark Rutland
2024-02-15 11:28     ` Mark Rutland
2024-02-16 12:30   ` Catalin Marinas
2024-02-16 12:30     ` Catalin Marinas
2024-02-16 12:30     ` Catalin Marinas
2024-02-15 10:32 ` [PATCH v6 14/18] arm64/mm: Implement new [get_and_]clear_full_ptes() batch APIs Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 11:28   ` Mark Rutland
2024-02-15 11:28     ` Mark Rutland
2024-02-15 11:28     ` Mark Rutland
2024-02-16 12:30   ` Catalin Marinas
2024-02-16 12:30     ` Catalin Marinas
2024-02-16 12:30     ` Catalin Marinas
2024-02-15 10:32 ` [PATCH v6 15/18] mm: Add pte_batch_hint() to reduce scanning in folio_pte_batch() Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 10:32 ` [PATCH v6 16/18] arm64/mm: Implement pte_batch_hint() Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-16 12:34   ` Catalin Marinas
2024-02-16 12:34     ` Catalin Marinas
2024-02-16 12:34     ` Catalin Marinas
2024-02-15 10:32 ` [PATCH v6 17/18] arm64/mm: __always_inline to improve fork() perf Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-16 12:34   ` Catalin Marinas
2024-02-16 12:34     ` Catalin Marinas
2024-02-16 12:34     ` Catalin Marinas
2024-02-15 10:32 ` [PATCH v6 18/18] arm64/mm: Automatically fold contpte mappings Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 10:32   ` Ryan Roberts
2024-02-15 11:30   ` Mark Rutland
2024-02-15 11:30     ` Mark Rutland
2024-02-15 11:30     ` Mark Rutland
2024-02-16 12:35   ` Catalin Marinas [this message]
2024-02-16 12:35     ` Catalin Marinas
2024-02-16 12:35     ` Catalin Marinas
2024-06-24 14:30   ` Kefeng Wang
2024-06-24 14:30     ` Kefeng Wang
2024-06-24 15:56     ` Ryan Roberts
2024-06-24 15:56       ` Ryan Roberts
2024-06-25  3:16       ` Kefeng Wang
2024-06-25  3:16         ` Kefeng Wang
2024-06-25  7:23         ` Baolin Wang
2024-06-25  7:23           ` Baolin Wang
2024-06-25 11:40           ` Ryan Roberts
2024-06-25 11:40             ` Ryan Roberts
2024-06-25 12:37             ` Baolin Wang
2024-06-25 12:37               ` Baolin Wang
2024-06-25 12:41               ` Ryan Roberts
2024-06-25 12:41                 ` Ryan Roberts
2024-06-25 13:06                 ` Matthew Wilcox
2024-06-25 13:06                   ` Matthew Wilcox
2024-06-25 13:41                   ` Ryan Roberts
2024-06-25 13:41                     ` Ryan Roberts
2024-06-25 14:06                     ` Matthew Wilcox
2024-06-25 14:06                       ` Matthew Wilcox
2024-06-25 14:45                       ` Ryan Roberts
2024-06-25 14:45                         ` Ryan Roberts
2024-06-25 12:23           ` Kefeng Wang
2024-06-25 12:23             ` Kefeng Wang
2024-02-15 11:36 ` [PATCH v6 00/18] Transparent Contiguous PTEs for User Mappings Mark Rutland
2024-02-15 11:36   ` Mark Rutland
2024-02-15 11:36   ` Mark Rutland

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=Zc9Wd0N03pPY5Nq5@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@redhat.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jhubbard@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=mingo@redhat.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=ryan.roberts@arm.com \
    --cc=shy828301@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=willy@infradead.org \
    --cc=x86@kernel.org \
    --cc=ziy@nvidia.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.