RE: [PATCH 0/6] x86/cpu hotplug: Wake up offline CPU via mwait ornmi

From: Peter Zijlstra
Date: Wed Jun 06 2012 - 04:30:33 EST


On Wed, 2012-06-06 at 00:09 +0200, Thomas Gleixner wrote:
> > I don't think so. Its perfectly fine to get TLB invalidate IPIs or
>
> No it's not. It's silly. I've observed the very issue more than once
> and others have done as well.
>
> If you have a process which has N threads where each thread is pinned
> to a core. Only one of them is doing file operations, which result in
> mmap/munmap and therefor in TLB shoot down IPIs even if it's ensured
> that the other pinned threads will never ever touch that
> mapping. That's a PITA as the workaround is to use NFS (how
> performant) or split the process into separate processes with shared
> memory to avoid the sane design of a single process where the
> housekeeping thread just writes to disk.
>
> This is exactly one of the issues where the application has more
> knowlegde than the kernel and there is no way to deal with it.

But simply refusing IPIs just because isn't going to work either.
Suppose the RT thing did touch the memory region.. then you'll end up
with stale TLB entries, those are not fun either.

We simply cannot not send TLB invalidates, me must assume userspace is
malicious - such is the burden of a general purpose kernel.

The only solution here is using multiple processes and shared memory.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/