Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1478613 > unrolled thread

Re: Ping: [PATCH v15 00/13] support "task_isolation" mode

Started byFrancis Giraldeau <francis.giraldeau@gmail.com>
First post2016-09-07 23:20 +0200
Last post2016-09-08 18:30 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Ping: [PATCH v15 00/13] support "task_isolation" mode Francis Giraldeau <francis.giraldeau@gmail.com> - 2016-09-07 23:20 +0200
    Re: Ping: [PATCH v15 00/13] support "task_isolation" mode Francis Giraldeau <francis.giraldeau@gmail.com> - 2016-09-07 23:50 +0200
    Re: Ping: [PATCH v15 00/13] support "task_isolation" mode Francis Giraldeau <francis.giraldeau@gmail.com> - 2016-09-08 18:30 +0200

#1478613 — Re: Ping: [PATCH v15 00/13] support "task_isolation" mode

FromFrancis Giraldeau <francis.giraldeau@gmail.com>
Date2016-09-07 23:20 +0200
SubjectRe: Ping: [PATCH v15 00/13] support "task_isolation" mode
Message-ID<seSqd-5fu-7@gated-at.bofh.it>
On 2016-08-29 12:27 PM, Chris Metcalf wrote:
> On 8/16/2016 5:19 PM, Chris Metcalf wrote:
>> Here is a respin of the task-isolation patch set.
>
> No concerns have been raised yet with the v15 version of the patch series
> in the two weeks since I posted it, and I think I have addressed all
> previously-raised concerns (or perhaps people have just given up arguing
> with me).

There is a cycle with header include in the v15 patch set on x86_64 that cause a compilation error. You will find the patch (and other fixes) in the following branch:

    https://github.com/giraldeau/linux/commits/dataplane-x86-fix-inc

In the test file, it is indicated to change timer-tick.c to disable the 1Hz tick, is there a reason why the change is not in the patch set? I added this trivial change in the branch dataplane-x86-fix-inc above.

The syscall test fails on x86:

    $ sudo ./isolation
    [...]
    test_syscall: FAIL (0x100)
    test_syscall (SIGUSR1): FAIL (0x100)

I wanted to debug this problem with gdb and a KVM virtual machine. However, the TSC clock source is detected as non reliable, even with the boot parameter tsc=reliable, and therefore prctl(PR_SET_TASK_ISOLATION, PR_TASK_ISOLATION_ENABLE) always returns EAGAIN. Is there a trick to run task isolation in a VM (at least for debugging purposes)?

BTW, this was causing the test to enter an infinite loop. If the clock source is not reliable, maybe a different error code should be returned, because this situation not transient. In the mean time, I added a check for 100 max retries in the test (prctl_safe()).

When running only the test_jitter(), the isolation mode is lost:

    [ 6741.566048] isolation/9515: task_isolation mode lost due to irq_work

With ftrace (events/workqueue/workqueue_execute_start), I get a bit more info:

     kworker/1:1-676   [001] ....  6610.097128: workqueue_execute_start: work struct ffff8801a784ca20: function dbs_work_handler

The governor was ondemand, so I tried to set the frequency scaling governor to performance, but that does not solve the issue. Is there a way to suppress this irq_work? Should we run the isolated task with high real-time priority, such that it never get preempted?

Thanks!

Francis

[toc] | [next] | [standalone]


#1478639

FromFrancis Giraldeau <francis.giraldeau@gmail.com>
Date2016-09-07 23:50 +0200
Message-ID<seSTf-5pg-3@gated-at.bofh.it>
In reply to#1478613
On 2016-09-07 05:11 PM, Francis Giraldeau wrote:
> The syscall test fails on x86:
>     $ sudo ./isolation
>     [...]
>     test_syscall: FAIL (0x100)
>     test_syscall (SIGUSR1): FAIL (0x100)
>
> I wanted to debug this problem with gdb and a KVM virtual machine. However, the TSC clock source is detected as non reliable, even with the boot parameter tsc=reliable, and therefore prctl(PR_SET_TASK_ISOLATION, PR_TASK_ISOLATION_ENABLE) always returns EAGAIN. Is there a trick to run task isolation in a VM (at least for debugging purposes)?

OK, got it. The guest kernel must be compiled with CONFIG_KVM_GUEST, and then with virsh edit, set the clock configuration of the VM (under <domain>):

 <clock offset='utc'>
    <timer name='kvmclock'/>
  </clock>

Of course, the jitter is horrible, but at least it is possible to debug with GDB.

Cheers,

Francis

[toc] | [prev] | [next] | [standalone]


#1479368

FromFrancis Giraldeau <francis.giraldeau@gmail.com>
Date2016-09-08 18:30 +0200
Message-ID<sfan8-87F-21@gated-at.bofh.it>
In reply to#1478613
On 2016-09-07 05:11 PM, Francis Giraldeau wrote:
> The syscall test fails on x86:
>     $ sudo ./isolation
>     [...]
>     test_syscall: FAIL (0x100)
>     test_syscall (SIGUSR1): FAIL (0x100)

The fix is indeed very simple:

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 7255367..449e2b5 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -139,7 +139,7 @@ struct thread_info {
 #define _TIF_WORK_SYSCALL_ENTRY        \
        (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT |   \
         _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT |       \
-        _TIF_NOHZ)
+        _TIF_NOHZ | _TIF_TASK_ISOLATION)
 
 /* work to do on any return to user space */
 #define _TIF_ALLWORK_MASK                                              \


I updated the branch accordingly:

https://github.com/giraldeau/linux/commit/057761af7bde087fa10aa42554a13a7b69071938

Thanks,

Francis

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web