linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: Yicong Yang <yangyicong@huawei.com>,
	akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-arm-kernel@lists.infradead.org, x86@kernel.org,
	catalin.marinas@arm.com, will@kernel.org,
	linux-doc@vger.kernel.org
Cc: wangkefeng.wang@huawei.com, darren@os.amperecomputing.com,
	peterz@infradead.org, Dave Hansen <dave.hansen@linux.intel.com>,
	yangyicong@hisilicon.com, Nadav Amit <namit@vmware.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	guojian@oppo.com, linux-riscv@lists.infradead.org,
	linux-s390@vger.kernel.org, zhangshiming@oppo.com,
	lipeifeng@oppo.com, corbet@lwn.net,
	Barry Song <21cnbao@gmail.com>, Ingo Molnar <mingo@redhat.com>,
	Mel Gorman <mgorman@suse.de>,
	linux-mips@vger.kernel.org, arnd@arndb.de, realmz6@gmail.com,
	Barry Song <v-songbaohua@oppo.com>,
	openrisc@lists.librecores.org, Borislav Petkov <bp@alien8.de>,
	prime.zeng@hisilicon.com, Thomas Gleixner <tglx@linutronix.de>,
	xhao@linux.alibaba.com, linux-kernel@vger.kernel.org,
	huzhanyuan@oppo.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 3/4] mm: rmap: Extend tlbbatch APIs to fit new platforms
Date: Fri, 9 Sep 2022 10:21:44 +0530	[thread overview]
Message-ID: <b621dbb6-a98f-003e-3578-fc8b0f512d4a@arm.com> (raw)
In-Reply-To: <20220822082120.8347-4-yangyicong@huawei.com>



On 8/22/22 13:51, Yicong Yang wrote:
> From: Barry Song <v-songbaohua@oppo.com>
> 
> Add uaddr to tlbbatch APIs so that platforms like ARM64 are

I guess 'uaddr' refers to a virtual address from the process address
space itself ? Please be more specific.

> able to apply this on their specific hardware features. For
> ARM64, this could be sending tlbi into hardware queues for
> the page with this particular uaddr.

This subject line and commit message here are misleading. The patch
adds an address argument to arch callback arch_tlbbatch_add_mm() as
arm64 platform could use that to perform the TLB flush batching ?

This patch can be folded into the next one, so that the requirement
for an additional argument 'uaddr' in the arch callback will be self
evident. OR if this is going to be a preparatory patch, then it must
explain how 'uaddr' argument is helpful on platforms like arm64 while
performing TLB flush batching. But TBH, just folding it to next patch
explains the context better.

> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: Nadav Amit <namit@vmware.com>
> Cc: Mel Gorman <mgorman@suse.de>
> Tested-by: Xin Hao <xhao@linux.alibaba.com>
> Signed-off-by: Barry Song <v-songbaohua@oppo.com>
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
>  arch/x86/include/asm/tlbflush.h |  3 ++-
>  mm/rmap.c                       | 10 ++++++----
>  2 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
> index 8a497d902c16..5bd78ae55cd4 100644
> --- a/arch/x86/include/asm/tlbflush.h
> +++ b/arch/x86/include/asm/tlbflush.h
> @@ -264,7 +264,8 @@ static inline u64 inc_mm_tlb_gen(struct mm_struct *mm)
>  }
>  
>  static inline void arch_tlbbatch_add_mm(struct arch_tlbflush_unmap_batch *batch,
> -					struct mm_struct *mm)
> +					struct mm_struct *mm,
> +					unsigned long uaddr)
>  {
>  	inc_mm_tlb_gen(mm);
>  	cpumask_or(&batch->cpumask, &batch->cpumask, mm_cpumask(mm));
> diff --git a/mm/rmap.c b/mm/rmap.c
> index a17a004550c6..7187a72b63b1 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -642,12 +642,13 @@ void try_to_unmap_flush_dirty(void)
>  #define TLB_FLUSH_BATCH_PENDING_LARGE			\
>  	(TLB_FLUSH_BATCH_PENDING_MASK / 2)
>  
> -static void set_tlb_ubc_flush_pending(struct mm_struct *mm, bool writable)
> +static void set_tlb_ubc_flush_pending(struct mm_struct *mm, bool writable,
> +				      unsigned long uaddr)
>  {
>  	struct tlbflush_unmap_batch *tlb_ubc = &current->tlb_ubc;
>  	int batch, nbatch;
>  
> -	arch_tlbbatch_add_mm(&tlb_ubc->arch, mm);
> +	arch_tlbbatch_add_mm(&tlb_ubc->arch, mm, uaddr);
>  	tlb_ubc->flush_required = true;
>  
>  	/*
> @@ -725,7 +726,8 @@ void flush_tlb_batched_pending(struct mm_struct *mm)
>  	}
>  }
>  #else
> -static void set_tlb_ubc_flush_pending(struct mm_struct *mm, bool writable)
> +static void set_tlb_ubc_flush_pending(struct mm_struct *mm, bool writable,
> +				      unsigned long uaddr)
>  {
>  }
>  
> @@ -1587,7 +1589,7 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma,
>  				 */
>  				pteval = ptep_get_and_clear(mm, address, pvmw.pte);
>  
> -				set_tlb_ubc_flush_pending(mm, pte_dirty(pteval));
> +				set_tlb_ubc_flush_pending(mm, pte_dirty(pteval), address);
>  			} else {
>  				pteval = ptep_clear_flush(vma, address, pvmw.pte);
>  			}

  parent reply	other threads:[~2022-09-09  4:52 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22  8:21 [PATCH v3 0/4] mm: arm64: bring up BATCHED_UNMAP_TLB_FLUSH Yicong Yang
2022-08-22  8:21 ` [PATCH v3 1/4] Revert "Documentation/features: mark BATCHED_UNMAP_TLB_FLUSH doesn't apply to ARM64" Yicong Yang
2022-09-09  4:26   ` Anshuman Khandual
2022-09-09  4:40     ` Barry Song
2022-08-22  8:21 ` [PATCH v3 2/4] mm/tlbbatch: Introduce arch_tlbbatch_should_defer() Yicong Yang
2022-08-24  9:40   ` Kefeng Wang
2022-09-09  4:16   ` Anshuman Khandual
2022-08-22  8:21 ` [PATCH v3 3/4] mm: rmap: Extend tlbbatch APIs to fit new platforms Yicong Yang
2022-08-24  9:43   ` Kefeng Wang
2022-09-09  4:51   ` Anshuman Khandual [this message]
2022-09-09  5:25     ` Barry Song
2022-08-22  8:21 ` [PATCH v3 4/4] arm64: support batched/deferred tlb shootdown during page reclamation Yicong Yang
2022-08-24  9:46   ` Kefeng Wang
2022-09-09  5:24   ` Anshuman Khandual
2022-09-09  5:35     ` Barry Song
2022-09-09  6:32       ` Yicong Yang
2022-09-15  6:07       ` Anshuman Khandual
2022-09-15  6:42         ` Barry Song
2022-09-15 14:31           ` Nadav Amit
2022-09-19  2:46             ` Anshuman Khandual
2022-09-19  4:24           ` Anshuman Khandual
2022-09-19  4:53             ` Barry Song
2022-09-19  5:08               ` Barry Song
2022-09-20  3:00   ` Anshuman Khandual
2022-09-20  3:39     ` Barry Song
2022-09-20  8:45       ` Anshuman Khandual
2022-09-21  1:50         ` Barry Song
2022-09-21  1:51           ` Barry Song
2022-09-21  3:33             ` Anshuman Khandual
2022-09-21  6:53   ` Anshuman Khandual
2022-09-21  7:15     ` Barry Song
2022-09-21  7:17     ` Nadav Amit
2022-09-22  3:15       ` Anshuman Khandual
2022-09-06  8:53 ` [PATCH v3 0/4] mm: arm64: bring up BATCHED_UNMAP_TLB_FLUSH Yicong Yang

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=b621dbb6-a98f-003e-3578-fc8b0f512d4a@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=darren@os.amperecomputing.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=guojian@oppo.com \
    --cc=hpa@zytor.com \
    --cc=huzhanyuan@oppo.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lipeifeng@oppo.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=namit@vmware.com \
    --cc=openrisc@lists.librecores.org \
    --cc=peterz@infradead.org \
    --cc=prime.zeng@hisilicon.com \
    --cc=realmz6@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=v-songbaohua@oppo.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    --cc=xhao@linux.alibaba.com \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@huawei.com \
    --cc=zhangshiming@oppo.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;
as well as URLs for NNTP newsgroup(s).