Re: Excessive TLB flush ranges

Thomas Gleixner
2023-05-16T06:46:09Z

On Tue, May 16 2023 at 08:37, Thomas Gleixner wrote:
> On Mon, May 15 2023 at 22:31, Russell King wrote:
>> In the case you have, are "start" and "end" set on function entry
>> to a range, or are they set to ULONG_MAX,0 ? What I'm wondering is
>> whether we could get away with just having flush_tlb_kernel_vas().
>>
>> Whether that's acceptable to others is a different question :)
>
> As I said flush_tlb_kernel_vas() should be
>
> void flush_tlb_kernel_vas(struct list_head *list, unsigned int num_entries):
>
> So that an architecture can decide whether it's worth to do walk the
> entries or whether it resorts to a flush all.

The only issue is that the flush range which is handed in from
_vm_unmap_aliases(), i.e. the conglomorate of to be mopped up TLBs is an
aggregate too. In this particular BPF case it's always one page, but
that obviously might end up being a horrible large range too.

Though there is no way to do that fake vmap_area trick I used in
__purge_vmap_area_lazy(). Bah!

Thanks,

tglx