lkml.org 
[lkml]   [2024]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC 00/14] Dynamic Kernel Stacks
> I think you'll need to broadcast an invalidate.
> Consider:
> CPU A: task allocates extra pages and adds something to some list.
> CPU B: accesses that data and maybe modifies it.
> Some page-table walk setup ut the TLB.
> CPU A: task detects the modify, removes the item from the list,
> collapses back the stack and sleeps.
> Stack pages freed.
> CPU A: task wakes up (on the same cpu for simplicity).
> Goes down a deep stack and puts an item on a list.
> Different physical pages are allocated.
> CPU B: accesses the associated KVA.
> It better not have a cached TLB.
>
> Doesn't that need an IPI?

Yes, this is annoying. If we share a stack with another CPU, then get
a new stack, and share it again with another CPU we get in trouble.
Yet, IPI during context switch would kill the performance :-\

I wonder if there is a way to optimize this scenario like doing IPI
invalidation only after stack sharing?

Pasha

\
 
 \ /
  Last update: 2024-05-27 15:53    [W:0.074 / U:0.820 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site