All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steve Capper <steve.capper@arm.com>
Cc: linux-mm@kvack.org, David Hildenbrand <david@redhat.com>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	nd@arm.com
Subject: Re: [PATCH] tlb: hugetlb: Add arm64 contiguous hint awareness
Date: Thu, 24 Mar 2022 16:58:52 +0100	[thread overview]
Message-ID: <20220324155852.GI8939@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <2dbb5cf0-ce41-da93-9a3d-5666601f71c5@arm.com>

On Thu, Mar 24, 2022 at 02:35:44PM +0000, Steve Capper wrote:
> > It occurs to me that perhaps this can be written like:
> > 
> > 	unsigned long _sz = huge_page_size(h);
> > 	if (_sz >= P4D_SIZE)
> > 		tlb_flush_p4d_range(tlb, address, _sz);
> > 	else if (_sz >= PUD_SIZE)
> > 		tlb_flush_pud_range(tlb, address, _sz);
> > 	else if (_sz >= PMD_SIZE)
> > 		tlb_flush_pmd_range(tlb, address, _sz);
> > 	else
> > 		tlb_flush_pte_range(tlb, address, _sz);
> > 	__tlb_remove_tlb_entry(tlb, ptep, address);
> > 
> > And then it can still be generic..
> 
> Thanks Peter,
> My concern with that would be the CONT_PMD_SIZE case would result in a call
> to tlb_flush_pte_range rather than tlb_flush_pmd_range causing some of the
> level parameters to be different.

arch/arm64/include/asm/pgtable-hwdef.h:#define CONT_PMD_SIZE            (CONT_PMDS * PMD_SIZE)

Seems to imply CONT_PMD_SIZE >= PMD_SIZE, and would thus tickle:

> > 	else if (_sz >= PMD_SIZE)
> > 		tlb_flush_pmd_range(tlb, address, _sz);

Or am I confused?


  reply	other threads:[~2022-03-24 15:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 16:52 [PATCH] tlb: hugetlb: Add arm64 contiguous hint awareness Steve Capper
2022-03-23 18:30 ` Catalin Marinas
2022-03-24 14:33 ` Peter Zijlstra
2022-03-24 14:35   ` Steve Capper
2022-03-24 15:58     ` Peter Zijlstra [this message]
2022-03-24 16:11       ` Steve Capper
2022-03-30 11:25         ` [PATCH v2] tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry Steve Capper
2022-03-30 12:05           ` David Hildenbrand
2022-03-30 14:04           ` Anshuman Khandual
2022-04-06 11:21             ` Peter Zijlstra
2022-04-04  6:07           ` Anshuman Khandual
2022-04-05 14:26           ` Catalin Marinas
2022-04-06 11:40           ` Peter Zijlstra
2022-04-06 12:05           ` Will Deacon

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=20220324155852.GI8939@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=nd@arm.com \
    --cc=steve.capper@arm.com \
    --cc=will@kernel.org \
    /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.