Re: [PATCH 7/7] x86,switch_mm: skip atomic operations for init_mm

From: Rik van Riel
Date: Sun Jul 15 2018 - 19:50:34 EST


On Mon, 2018-07-16 at 01:04 +0200, Ingo Molnar wrote:
> * Rik van Riel <riel@xxxxxxxxxxx> wrote:
>
> > + /*
> > + * Stop remote flushes for the previous mm.
> > + * Skip the idle task; we never send init_mm TLB
> > flushing IPIs,
> > + * but the bitmap manipulation can cause cache
> > line contention.
> > + */
> > + if (real_prev != &init_mm) {
> > + VM_WARN_ON_ONCE(!cpumask_test_cpu(cpu,
> > + mm_cpumask(real_pr
> > ev)));
> > + cpumask_clear_cpu(cpu,
> > mm_cpumask(real_prev));
>
> BTW., could this optimization be (safely) extended to all (or most)
> !task->mm
> kernel threads?
>
> In particular softirq and threaded irq handlers could benefit greatly
> I suspect in
> certain networking intense workloads that happen to active them.

Yes, it could.

Are there kernel threads that use something other than
init_mm today?

--
All Rights Reversed.

Attachment: signature.asc
Description: This is a digitally signed message part