From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>,
Matthew Wilcox <willy@infradead.org>,
Lance Yang <lance.yang@linux.dev>
Cc: Peter Zijlstra <peterz@infradead.org>,
Liam.Howlett@oracle.com, akpm@linux-foundation.org,
aneesh.kumar@kernel.org, arnd@arndb.de, baohua@kernel.org,
baolin.wang@linux.alibaba.com, boris.ostrovsky@oracle.com,
bp@alien8.de, dave.hansen@linux.intel.com, dev.jain@arm.com,
hpa@zytor.com, hughd@google.com, ioworker0@gmail.com,
jannh@google.com, jgross@suse.com, kvm@vger.kernel.org,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, lorenzo.stoakes@oracle.com, mingo@redhat.com,
npache@redhat.com, npiggin@gmail.com, pbonzini@redhat.com,
riel@surriel.com, ryan.roberts@arm.com, seanjc@google.com,
shy828301@gmail.com, tglx@linutronix.de,
virtualization@lists.linux.dev, will@kernel.org, x86@kernel.org,
ypodemsk@redhat.com, ziy@nvidia.com
Subject: Re: [PATCH v4 0/3] targeted TLB sync IPIs for lockless page table
Date: Thu, 5 Feb 2026 23:49:48 +0100 [thread overview]
Message-ID: <bc489455-bb18-44dc-8518-ae75abda6bec@kernel.org> (raw)
In-Reply-To: <dfdfeac9-5cd5-46fc-a5c1-9ccf9bd3502a@intel.com>
On 2/5/26 19:36, Dave Hansen wrote:
> On 2/5/26 09:06, David Hildenbrand (Arm) wrote:
>>> But can't we RCU-free the page table? Why do we need to wait for the
>>> RCU readers to finish?
>>
>> For unsharing hugetlb PMD tables the problem is not the freeing but the
>> reuse of the PMD table for other purposes in the last remaining user.
>> It's complicated.
>
> Letting the previously-shared table get released to everything else in
> the system sounds like a fixable problem. tlb_flush_unshared_tables()
> talks about this, and it makes sense that once locks get dropped that
> something else could get mapped in and start using the PMD.
Yeah, I tried to document that carefully.
>
> The RCU way of fixing that would be to allocate new page table, replace
> the old one, and RCU-free the old one. Read, Copy, Update. :)
>
> It does temporarily eat up an extra page, and cost an extra copy. But
> neither of those seems expensive compared to IPI'ing the world.
I played with many such ideas, including never reusing a page table
again once it was once shared. All turned out rather horrible.
RCU-way: replacing a shared page table involves updating all processes
that share the page table :/ . I think another issue I stumbled into
while trying to implement was around failing to allocate memory (but
being required to make progress). It all turned to quite some complexity
and inefficiency, so I had to give up on that. :)
>
>> For page table freeing, we only do it if we fail to allocate memory --
>> if we cannot use RCU IIRC.
>
> But that case is fine to be slow and use synchronize_rcu(). If you're
> failing to allocate a single page, you're in a way slow path anyway.
That's true. We could likely do that already and avoid the IPI broadcast
there that was once reported to be a problem for RT applications.
--
Cheers,
David
next prev parent reply other threads:[~2026-02-05 22:50 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 7:45 [PATCH v4 0/3] targeted TLB sync IPIs for lockless page table walkers Lance Yang
2026-02-02 7:45 ` [PATCH v4 1/3] mm: use targeted IPIs for TLB sync with " Lance Yang
2026-02-02 9:42 ` Peter Zijlstra
2026-02-02 12:14 ` Lance Yang
2026-02-02 12:51 ` Peter Zijlstra
2026-02-02 13:23 ` Lance Yang
2026-02-02 13:42 ` Peter Zijlstra
2026-02-02 14:28 ` Lance Yang
2026-02-02 16:20 ` Dave Hansen
2026-02-02 11:37 ` kernel test robot
2026-02-03 23:49 ` kernel test robot
2026-02-02 7:45 ` [PATCH v4 2/3] mm: switch callers to tlb_remove_table_sync_mm() Lance Yang
2026-02-02 7:45 ` [PATCH v4 3/3] x86/tlb: add architecture-specific TLB IPI optimization support Lance Yang
2026-02-25 20:11 ` Sean Christopherson
2026-02-26 11:37 ` Lance Yang
2026-02-26 18:24 ` Sean Christopherson
2026-03-01 6:56 ` Lance Yang
2026-02-02 9:54 ` [PATCH v4 0/3] targeted TLB sync IPIs for lockless page table walkers Peter Zijlstra
2026-02-02 11:00 ` [PATCH v4 0/3] targeted TLB sync IPIs for lockless page table Lance Yang
2026-02-02 12:50 ` Peter Zijlstra
2026-02-02 12:58 ` Lance Yang
2026-02-02 13:07 ` Lance Yang
2026-02-02 13:37 ` Peter Zijlstra
2026-02-02 14:37 ` Lance Yang
2026-02-02 15:09 ` Peter Zijlstra
2026-02-02 15:52 ` Lance Yang
2026-02-05 13:25 ` David Hildenbrand (Arm)
2026-02-05 15:01 ` Lance Yang
2026-02-05 15:05 ` David Hildenbrand (Arm)
2026-02-05 15:28 ` Lance Yang
2026-02-05 15:09 ` Dave Hansen
2026-02-05 15:31 ` Lance Yang
2026-02-05 15:41 ` Dave Hansen
2026-02-05 16:30 ` Lance Yang
2026-02-05 16:46 ` David Hildenbrand (Arm)
2026-02-05 16:48 ` Matthew Wilcox
2026-02-05 17:06 ` David Hildenbrand (Arm)
2026-02-05 18:36 ` Dave Hansen
2026-02-05 22:49 ` David Hildenbrand (Arm) [this message]
2026-02-05 21:30 ` David Hildenbrand (Arm)
2026-02-05 17:00 ` Dave Hansen
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=bc489455-bb18-44dc-8518-ae75abda6bec@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@kernel.org \
--cc=arnd@arndb.de \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dev.jain@arm.com \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=ioworker0@gmail.com \
--cc=jannh@google.com \
--cc=jgross@suse.com \
--cc=kvm@vger.kernel.org \
--cc=lance.yang@linux.dev \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mingo@redhat.com \
--cc=npache@redhat.com \
--cc=npiggin@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=ryan.roberts@arm.com \
--cc=seanjc@google.com \
--cc=shy828301@gmail.com \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux.dev \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
--cc=ypodemsk@redhat.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.