Re: [PATCH v7 05/11] task_isolation: add debug boot flag

From: Andy Lutomirski
Date: Mon Sep 28 2015 - 18:40:34 EST


On Mon, Sep 28, 2015 at 2:55 PM, Chris Metcalf <cmetcalf@xxxxxxxxxx> wrote:
> On 09/28/2015 04:59 PM, Andy Lutomirski wrote:
>>
>> On Mon, Sep 28, 2015 at 11:17 AM, Chris Metcalf <cmetcalf@xxxxxxxxxx>
>> wrote:
>>>
>>> The new "task_isolation_debug" flag simplifies debugging
>>> of TASK_ISOLATION kernels when processes are running in
>>> PR_TASK_ISOLATION_ENABLE mode. Such processes should get no
>>> interrupts from the kernel, and if they do, when this boot flag is
>>> specified a kernel stack dump on the console is generated.
>>>
>>> It's possible to use ftrace to simply detect whether a task_isolation
>>> core has unexpectedly entered the kernel. But what this boot flag
>>> does is allow the kernel to provide better diagnostics, e.g. by
>>> reporting in the IPI-generating code what remote core and context
>>> is preparing to deliver an interrupt to a task_isolation core.
>>>
>>> It may be worth considering other ways to generate useful debugging
>>> output rather than console spew, but for now that is simple and direct.
>>
>> This may be addressed elsewhere, but is there anything that alerts the
>> task or the admin if it's PR_TASK_ISOLATION_ENABLE and *not* on a
>> nohz_full core?
>
>
> No, and I've thought about it without coming up with a great
> solution. We could certainly fail the initial prctl() if the caller
> was not on a nohz_full core. But this seems a little asymmetric
> since the task could be on such a core at prctl() time, and then
> do a sched_setaffinity() later to a non-nohz-full core. Would
> we want to fail that call? Seems heavy-handed. Or we could
> then clear the task-isolation state and emit a console message.

If I were writing a program that used this feature, I think I'd want
to know early that it's not going to work so I can tell the admin very
loudly to fix it. Maybe just failing the prctl would be enough. If
someone turns on the prctl and then changes their affinity, maybe we
should treat it as though they're just asking for trouble and allow
it.

--Andy
--
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/