All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Popple <apopple@nvidia.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Marc Zyngier <maz@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Matthew Wilcox <willy@infradead.org>, Yu Zhao <yuzhao@google.com>,
	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>, Yang Shi <shy828301@gmail.com>,
	linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 03/16] mm: Batch-clear PTE ranges during zap_pte_range()
Date: Wed, 20 Dec 2023 16:25:07 +1100	[thread overview]
Message-ID: <87zfy5zbmu.fsf@nvdebian.thelocal> (raw)
In-Reply-To: <20231218105100.172635-4-ryan.roberts@arm.com>


Ryan Roberts <ryan.roberts@arm.com> writes:

[...]

> diff --git a/mm/mmu_gather.c b/mm/mmu_gather.c
> index 4f559f4ddd21..39725756e6bf 100644
> --- a/mm/mmu_gather.c
> +++ b/mm/mmu_gather.c
> @@ -47,6 +47,21 @@ static bool tlb_next_batch(struct mmu_gather *tlb)
>  	return true;
>  }
>  
> +unsigned int tlb_reserve_space(struct mmu_gather *tlb, unsigned int nr)
> +{
> +	struct mmu_gather_batch *batch = tlb->active;
> +	unsigned int nr_alloc = batch->max - batch->nr;
> +
> +	while (nr_alloc < nr) {
> +		if (!tlb_next_batch(tlb))
> +			break;
> +		nr_alloc += tlb->active->max;
> +	}
> +
> +	tlb->active = batch;
> +	return nr_alloc;
> +}

Agree this addresses my previous comment nicely, so you can add:

Reviewed-by: Alistair Popple <apopple@nvidia.com>

> +
>  #ifdef CONFIG_SMP
>  static void tlb_flush_rmap_batch(struct mmu_gather_batch *batch, struct vm_area_struct *vma)
>  {


_______________________________________________
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: Alistair Popple <apopple@nvidia.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>, Ard Biesheuvel <ardb@kernel.org>,
	Marc Zyngier <maz@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Matthew Wilcox <willy@infradead.org>, Yu Zhao <yuzhao@google.com>,
	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>, Yang Shi <shy828301@gmail.com>,
	linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 03/16] mm: Batch-clear PTE ranges during zap_pte_range()
Date: Wed, 20 Dec 2023 16:25:07 +1100	[thread overview]
Message-ID: <87zfy5zbmu.fsf@nvdebian.thelocal> (raw)
In-Reply-To: <20231218105100.172635-4-ryan.roberts@arm.com>


Ryan Roberts <ryan.roberts@arm.com> writes:

[...]

> diff --git a/mm/mmu_gather.c b/mm/mmu_gather.c
> index 4f559f4ddd21..39725756e6bf 100644
> --- a/mm/mmu_gather.c
> +++ b/mm/mmu_gather.c
> @@ -47,6 +47,21 @@ static bool tlb_next_batch(struct mmu_gather *tlb)
>  	return true;
>  }
>  
> +unsigned int tlb_reserve_space(struct mmu_gather *tlb, unsigned int nr)
> +{
> +	struct mmu_gather_batch *batch = tlb->active;
> +	unsigned int nr_alloc = batch->max - batch->nr;
> +
> +	while (nr_alloc < nr) {
> +		if (!tlb_next_batch(tlb))
> +			break;
> +		nr_alloc += tlb->active->max;
> +	}
> +
> +	tlb->active = batch;
> +	return nr_alloc;
> +}

Agree this addresses my previous comment nicely, so you can add:

Reviewed-by: Alistair Popple <apopple@nvidia.com>

> +
>  #ifdef CONFIG_SMP
>  static void tlb_flush_rmap_batch(struct mmu_gather_batch *batch, struct vm_area_struct *vma)
>  {



  reply	other threads:[~2023-12-20  5:28 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 10:50 [PATCH v4 00/16] Transparent Contiguous PTEs for User Mappings Ryan Roberts
2023-12-18 10:50 ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 01/16] mm: thp: Batch-collapse PMD with set_ptes() Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 17:40   ` David Hildenbrand
2023-12-18 17:40     ` David Hildenbrand
2023-12-19  8:18     ` Ryan Roberts
2023-12-19  8:18       ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 02/16] mm: Batch-copy PTE ranges during fork() Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 17:47   ` David Hildenbrand
2023-12-18 17:47     ` David Hildenbrand
2023-12-19  8:30     ` Ryan Roberts
2023-12-19  8:30       ` Ryan Roberts
2023-12-19 11:29       ` David Hildenbrand
2023-12-19 11:29         ` David Hildenbrand
2023-12-19 17:22       ` David Hildenbrand
2023-12-19 17:22         ` David Hildenbrand
2023-12-19 17:42         ` Ryan Roberts
2023-12-19 17:42           ` Ryan Roberts
2023-12-20  9:17           ` David Hildenbrand
2023-12-20  9:17             ` David Hildenbrand
2023-12-20  9:51             ` Ryan Roberts
2023-12-20  9:51               ` Ryan Roberts
2023-12-20  9:54               ` David Hildenbrand
2023-12-20  9:54                 ` David Hildenbrand
2023-12-20 10:11                 ` Ryan Roberts
2023-12-20 10:11                   ` Ryan Roberts
2023-12-20 10:16                   ` David Hildenbrand
2023-12-20 10:16                     ` David Hildenbrand
2023-12-20 10:41                     ` Ryan Roberts
2023-12-20 10:41                       ` Ryan Roberts
2023-12-20 10:56                       ` David Hildenbrand
2023-12-20 10:56                         ` David Hildenbrand
2023-12-20 11:28                         ` Ryan Roberts
2023-12-20 11:28                           ` Ryan Roberts
2023-12-20 11:36                           ` David Hildenbrand
2023-12-20 11:36                             ` David Hildenbrand
2023-12-20 11:51                             ` Ryan Roberts
2023-12-20 11:51                               ` Ryan Roberts
2023-12-20 11:58                               ` David Hildenbrand
2023-12-20 11:58                                 ` David Hildenbrand
2023-12-20 12:04                                 ` Ryan Roberts
2023-12-20 12:04                                   ` Ryan Roberts
2023-12-20 12:08                                   ` David Hildenbrand
2023-12-20 12:08                                     ` David Hildenbrand
2023-12-20 12:54                                   ` David Hildenbrand
2023-12-20 12:54                                     ` David Hildenbrand
2023-12-20 13:02                                     ` Ryan Roberts
2023-12-20 13:02                                       ` Ryan Roberts
2023-12-20 13:06                                   ` David Hildenbrand
2023-12-20 13:06                                     ` David Hildenbrand
2023-12-20 13:10                                     ` Ryan Roberts
2023-12-20 13:10                                       ` Ryan Roberts
2023-12-20 13:13                                       ` David Hildenbrand
2023-12-20 13:13                                         ` David Hildenbrand
2023-12-20 13:33                                         ` Ryan Roberts
2023-12-20 13:33                                           ` Ryan Roberts
2023-12-20 14:00                                           ` David Hildenbrand
2023-12-20 14:00                                             ` David Hildenbrand
2023-12-20 15:05                                             ` Ryan Roberts
2023-12-20 15:05                                               ` Ryan Roberts
2023-12-20 15:35                                               ` David Hildenbrand
2023-12-20 15:35                                                 ` David Hildenbrand
2023-12-20 15:59                                                 ` Ryan Roberts
2023-12-20 15:59                                                   ` Ryan Roberts
2023-12-20  9:57               ` Ryan Roberts
2023-12-20  9:57                 ` Ryan Roberts
2023-12-20 10:00                 ` David Hildenbrand
2023-12-20 10:00                   ` David Hildenbrand
2023-12-18 10:50 ` [PATCH v4 03/16] mm: Batch-clear PTE ranges during zap_pte_range() Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-20  5:25   ` Alistair Popple [this message]
2023-12-20  5:25     ` Alistair Popple
2023-12-18 10:50 ` [PATCH v4 04/16] arm64/mm: set_pte(): New layer to manage contig bit Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 05/16] arm64/mm: set_ptes()/set_pte_at(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 06/16] arm64/mm: pte_clear(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 07/16] arm64/mm: ptep_get_and_clear(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 08/16] arm64/mm: ptep_test_and_clear_young(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 09/16] arm64/mm: ptep_clear_flush_young(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 10/16] arm64/mm: ptep_set_wrprotect(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 11/16] arm64/mm: ptep_set_access_flags(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 12/16] arm64/mm: ptep_get(): " Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 13/16] arm64/mm: Split __flush_tlb_range() to elide trailing DSB Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:50 ` [PATCH v4 14/16] arm64/mm: Wire up PTE_CONT for user mappings Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2024-01-15 15:14   ` Alexandre Ghiti
2024-01-15 15:14     ` Alexandre Ghiti
2024-01-15 16:27     ` Ryan Roberts
2024-01-15 16:27       ` Ryan Roberts
2024-01-15 21:23       ` Alexandre Ghiti
2024-01-15 21:23         ` Alexandre Ghiti
2024-01-16 14:44         ` Ryan Roberts
2024-01-16 14:44           ` Ryan Roberts
2024-01-16 20:41           ` Alexandre Ghiti
2024-01-16 20:41             ` Alexandre Ghiti
2023-12-18 10:50 ` [PATCH v4 15/16] arm64/mm: Implement new helpers to optimize fork() Ryan Roberts
2023-12-18 10:50   ` Ryan Roberts
2023-12-18 10:51 ` [PATCH v4 16/16] arm64/mm: Implement clear_ptes() to optimize exit, munmap, dontneed Ryan Roberts
2023-12-18 10:51   ` Ryan Roberts
2023-12-20  5:28   ` Alistair Popple
2023-12-20  5:28     ` Alistair Popple
2023-12-20  8:42     ` Ryan Roberts
2023-12-20  8:42       ` Ryan Roberts

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=87zfy5zbmu.fsf@nvdebian.thelocal \
    --to=apopple@nvidia.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=anshuman.khandual@arm.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=david@redhat.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.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=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=ryabinin.a.a@gmail.com \
    --cc=ryan.roberts@arm.com \
    --cc=shy828301@gmail.com \
    --cc=suzuki.poulose@arm.com \
    --cc=vincenzo.frascino@arm.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=willy@infradead.org \
    --cc=yuzenghui@huawei.com \
    --cc=yuzhao@google.com \
    --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.