linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: Luiz Capitulino <luizcap@redhat.com>,
	osalvador@suse.de, akpm@linux-foundation.org, david@redhat.com,
	aneesh.kumar@kernel.org, borntraeger@linux.ibm.com,
	mike.kravetz@oracle.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-s390@vger.kernel.org
Subject: Re: [PATCH] mm: hugetlb: fix HVO crash on s390
Date: Tue, 28 Oct 2025 16:48:57 +0000	[thread overview]
Message-ID: <5c72e064-9298-490e-b05a-16be6b5590b7@oracle.com> (raw)
In-Reply-To: <20251028161426.35377Af6-hca@linux.ibm.com>

On 28/10/2025 16:14, Heiko Carstens wrote:
> On Tue, Oct 28, 2025 at 04:05:45PM +0000, Joao Martins wrote:
>>> diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c
>>> index ba0fb1b6a5a8..5819a3088850 100644
>>> --- a/mm/hugetlb_vmemmap.c
>>> +++ b/mm/hugetlb_vmemmap.c
>>> @@ -48,6 +48,15 @@ struct vmemmap_remap_walk {
>>>  	unsigned long		flags;
>>>  };
>>>  
>>> +static inline void vmemmap_flush_tlb_all(void)
>>> +{
>>> +#ifdef CONFIG_S390
>>> +	__tlb_flush_kernel();
>>> +#else
>>> +	flush_tlb_all();
>>> +#endif
>>> +}
>>> +
>>
>> Wouldn't a better fix be to implement flush_tlb_all() in
>> s390/include/asm/tlbflush.h since that aliases to __tlb_flush_kernel()?
> 
> The question is rather what is flush_tlb_all() supposed to flush? Is
> it supposed to flush only tlb entries corresponding to the kernel
> address space, or should it flush just everything?
> 
The latter i.e. everything

At least as far as I understand

> Within this context it looks like only tlb flushing for the kernel
> address space is required(?)

That's correct. We are changing the vmemmap which is in the kernel address
space, so that's the intent.

flush_tlb_all() however is the *closest* equivalent to this that's behind an
arch generic API i.e. flushing kernel address space on all CPUs TLBs. IIUC, x86
when doing flush_tlb_kernel_range with enough pages it switches to flush_tlb_all
(these days on modern AMDs it's even one instruction solely in the calling CPU).


  reply	other threads:[~2025-10-28 16:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28 15:39 Luiz Capitulino
2025-10-28 16:05 ` Joao Martins
2025-10-28 16:13   ` David Hildenbrand
2025-10-28 16:14   ` Heiko Carstens
2025-10-28 16:48     ` Joao Martins [this message]
2025-10-28 17:02       ` Heiko Carstens
2025-10-28 17:15         ` Luiz Capitulino
2025-10-28 19:37           ` Heiko Carstens
2025-10-28 21:14             ` Luiz Capitulino

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=5c72e064-9298-490e-b05a-16be6b5590b7@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@kernel.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=luizcap@redhat.com \
    --cc=mike.kravetz@oracle.com \
    --cc=osalvador@suse.de \
    /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