Re: [EXT] Re: [PATCH v5 7/9] task_isolation: don't interrupt CPUs with tick_nohz_full_kick_cpu()

2020-12-03 Thread Alex Belits
On Wed, 2020-12-02 at 14:20 +, Mark Rutland wrote: > External Email > > --- > --- > On Mon, Nov 23, 2020 at 05:58:22PM +0000, Alex Belits wrote: > > From: Yuri Norov > > > > For nohz_full

Re: [EXT] Re: [PATCH v5 5/9] task_isolation: Add driver-specific hooks

2020-12-03 Thread Alex Belits
On Wed, 2020-12-02 at 14:18 +, Mark Rutland wrote: > External Email > > --- > --- > On Mon, Nov 23, 2020 at 05:57:42PM +0000, Alex Belits wrote: > > Some drivers don't call functions that call >

Re: [EXT] Re: [PATCH v5 0/9] "Task_isolation" mode

2020-12-03 Thread Alex Belits
On Wed, 2020-12-02 at 14:02 +, Mark Rutland wrote: > On Tue, Nov 24, 2020 at 05:40:49PM +0000, Alex Belits wrote: > > > > > I am having problems applying the patchset to today's linux-next. > > > > > > Which kernel should I be using ? > &g

Re: [EXT] Re: [PATCH v5 6/9] task_isolation: arch/arm64: enable task isolation functionality

2020-12-03 Thread Alex Belits
On Wed, 2020-12-02 at 13:59 +, Mark Rutland wrote: > External Email > > --- > --- > Hi Alex, > > On Mon, Nov 23, 2020 at 05:58:06PM +, Alex Belits wrote: > >

Re: [EXT] Re: [PATCH v5 9/9] task_isolation: kick_all_cpus_sync: don't kick isolated cpus

2020-11-24 Thread Alex Belits
On Tue, 2020-11-24 at 00:21 +0100, Frederic Weisbecker wrote: > On Mon, Nov 23, 2020 at 10:39:34PM +0000, Alex Belits wrote: > > > > This is different from timers. The original design was based on the > > idea that every CPU should be able to enter kernel at any time and &g

Re: [EXT] Re: [PATCH v5 0/9] "Task_isolation" mode

2020-11-24 Thread Alex Belits
On Tue, 2020-11-24 at 08:36 -0800, Tom Rix wrote: > External Email > > --- > --- > > On 11/23/20 9:42 AM, Alex Belits wrote: > > This is an update of task isolation work that was originally done >

Re: [EXT] Re: [PATCH v5 9/9] task_isolation: kick_all_cpus_sync: don't kick isolated cpus

2020-11-23 Thread Alex Belits
On Mon, 2020-11-23 at 23:29 +0100, Frederic Weisbecker wrote: > External Email > > --- > --- > On Mon, Nov 23, 2020 at 05:58:42PM +0000, Alex Belits wrote: > > From: Yuri Norov > > > > Make sure t

Re: [PATCH v5 7/9] task_isolation: don't interrupt CPUs with tick_nohz_full_kick_cpu()

2020-11-23 Thread Alex Belits
On Mon, 2020-11-23 at 23:13 +0100, Frederic Weisbecker wrote: > External Email > > --- > --- > Hi Alex, > > On Mon, Nov 23, 2020 at 05:58:22PM +, Alex Belits wrote: > > From: Yuri Norov >

[PATCH v5 8/9] task_isolation: ringbuffer: don't interrupt CPUs running isolated tasks on buffer resize

2020-11-23 Thread Alex Belits
aking] Signed-off-by: Alex Belits --- kernel/trace/ring_buffer.c | 63 ++ 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index dc83b3fa9fe7..9e4fb3ed2af0 100644 --- a/kernel/trace/ring_buf

[PATCH v5 9/9] task_isolation: kick_all_cpus_sync: don't kick isolated cpus

2020-11-23 Thread Alex Belits
From: Yuri Norov Make sure that kick_all_cpus_sync() does not call CPUs that are running isolated tasks. Signed-off-by: Yuri Norov [abel...@marvell.com: use safe task_isolation_cpumask() implementation] Signed-off-by: Alex Belits --- kernel/smp.c | 14 +- 1 file changed, 13

[PATCH v5 7/9] task_isolation: don't interrupt CPUs with tick_nohz_full_kick_cpu()

2020-11-23 Thread Alex Belits
dated, only exclude CPUs running isolated tasks] Signed-off-by: Alex Belits --- kernel/time/tick-sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index a213952541db..6c8679e200f0 100644 --- a/kernel/time/tick-sched.c

[PATCH v5 6/9] task_isolation: arch/arm64: enable task isolation functionality

2020-11-23 Thread Alex Belits
ollow this rule. handle_domain_irq() -> task_isolation_kernel_enter() do_handle_IPI() -> task_isolation_kernel_enter() (may be redundant) nmi_enter() -> task_isolation_kernel_enter() Signed-off-by: Chris Metcalf [abel...@marvell.com: simplified to match kernel 5.10] Signed-off-by: Alex Bel

[PATCH v5 5/9] task_isolation: Add driver-specific hooks

2020-11-23 Thread Alex Belits
Some drivers don't call functions that call task_isolation_kernel_enter() in interrupt handlers. Call it directly. Signed-off-by: Alex Belits --- drivers/irqchip/irq-armada-370-xp.c | 6 ++ drivers/irqchip/irq-gic-v3.c| 3 +++ drivers/irqchip/irq-gic.c | 3 +++ dr

[PATCH v5 4/9] task_isolation: Add task isolation hooks to arch-independent code

2020-11-23 Thread Alex Belits
-off-by: Alex Belits --- include/linux/hardirq.h | 2 ++ include/linux/sched.h | 2 ++ kernel/context_tracking.c | 5 + kernel/entry/common.c | 10 +- kernel/irq/irqdesc.c | 5 + 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/linux/hardirq.h

[PATCH v5 3/9] task_isolation: userspace hard isolation from kernel

2020-11-23 Thread Alex Belits
to isolation bit in ll_isol_flags is visible to userspace as /sys/devices/system/cpu/isolation_running, and can be used for monitoring. Signed-off-by: Chris Metcalf Signed-off-by: Alex Belits --- .../admin-guide/kernel-parameters.txt | 6 + drivers/base/cpu.c

[PATCH v5 2/9] task_isolation: vmstat: add vmstat_idle function

2020-11-23 Thread Alex Belits
From: Chris Metcalf This function checks to see if a vmstat worker is not running, and the vmstat diffs don't require an update. The function is called from the task-isolation code to see if we need to actually do some work to quiet vmstat. Signed-off-by: Chris Metcalf Signed-off-by:

[PATCH v5 1/9] task_isolation: vmstat: add quiet_vmstat_sync function

2020-11-23 Thread Alex Belits
ion of the function that guarantees that the vmstat worker will not run on the core on return from the function. Add a quiet_vmstat_sync() function with that semantic. Signed-off-by: Chris Metcalf Signed-off-by: Alex Belits --- include/linux/vmstat.h | 2 ++ mm/vmstat.c| 9

[PATCH v5 0/9] "Task_isolation" mode

2020-11-23 Thread Alex Belits
This is an update of task isolation work that was originally done by Chris Metcalf and maintained by him until November 2017. It is adapted to the current kernel and cleaned up to implement its functionality in a more complete and cleaner manner. Previous version is at https://lore.kernel.org/net

Re: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel

2020-10-17 Thread Alex Belits
On Sat, 2020-10-17 at 18:08 +0200, Thomas Gleixner wrote: > On Sat, Oct 17 2020 at 01:08, Alex Belits wrote: > > On Mon, 2020-10-05 at 14:52 -0400, Nitesh Narayan Lal wrote: > > > On 10/4/20 7:14 PM, Frederic Weisbecker wrote: > > I think that the goal of "finding sou

Re: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel

2020-10-16 Thread Alex Belits
On Mon, 2020-10-05 at 14:52 -0400, Nitesh Narayan Lal wrote: > On 10/4/20 7:14 PM, Frederic Weisbecker wrote: > > On Sun, Oct 04, 2020 at 02:44:39PM +0000, Alex Belits wrote: > > > On Thu, 2020-10-01 at 15:56 +0200, Frederic Weisbecker wrote: >

Re: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel

2020-10-16 Thread Alex Belits
On Tue, 2020-10-06 at 12:35 +0200, Frederic Weisbecker wrote: > On Mon, Oct 05, 2020 at 02:52:49PM -0400, Nitesh Narayan Lal wrote: > > On 10/4/20 7:14 PM, Frederic Weisbecker wrote: > > > On Sun, Oct 04, 2020 at 02:44:39PM +, Alex Belits wrote: > > > > >

Re: [EXT] Re: [PATCH v4 10/13] task_isolation: don't interrupt CPUs with tick_nohz_full_kick_cpu()

2020-10-16 Thread Alex Belits
On Tue, 2020-10-06 at 23:41 +0200, Frederic Weisbecker wrote: > On Sun, Oct 04, 2020 at 03:22:09PM +0000, Alex Belits wrote: > > On Thu, 2020-10-01 at 16:44 +0200, Frederic Weisbecker wrote: > > > > @@ -268,7 +269,8 @@ static void tick_nohz_full_kick(void) >

Re: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel

2020-10-06 Thread Alex Belits
On Mon, 2020-10-05 at 01:14 +0200, Frederic Weisbecker wrote: > Speaking of which, I agree with Thomas that it's unnecessary. > > > It's > > > too much > > > code and complexity. We can use the existing trace events and > > > perform > > > the > > > analysis from userspace to find the source of the

Re: [EXT] Re: [PATCH v4 11/13] task_isolation: net: don't flush backlog on CPUs running isolated tasks

2020-10-04 Thread Alex Belits
On Thu, 2020-10-01 at 16:47 +0200, Frederic Weisbecker wrote: > External Email > > --- > --- > On Wed, Jul 22, 2020 at 02:58:24PM +0000, Alex Belits wrote: > > From: Yuri Norov > > > > If CPU r

Re: [EXT] Re: [PATCH v4 10/13] task_isolation: don't interrupt CPUs with tick_nohz_full_kick_cpu()

2020-10-04 Thread Alex Belits
On Thu, 2020-10-01 at 16:44 +0200, Frederic Weisbecker wrote: > External Email > > --- > --- > On Wed, Jul 22, 2020 at 02:57:33PM +0000, Alex Belits wrote: > > From: Yuri Norov > > > > For nohz_fu

Re: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel

2020-10-04 Thread Alex Belits
On Thu, 2020-10-01 at 16:40 +0200, Frederic Weisbecker wrote: > External Email > > --- > --- > On Wed, Jul 22, 2020 at 02:49:49PM +0000, Alex Belits wrote: > > +/** > > + * task_isolation_kernel_ent

Re: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel

2020-10-04 Thread Alex Belits
On Thu, 2020-10-01 at 15:56 +0200, Frederic Weisbecker wrote: > External Email > > --- > --- > On Wed, Jul 22, 2020 at 02:49:49PM +0000, Alex Belits wrote: > > +/* > > + * Description of the last two t

Re: [EXT] Re: [PATCH v4 00/13] "Task_isolation" mode

2020-07-23 Thread Alex Belits
On Thu, 2020-07-23 at 23:44 +0200, Thomas Gleixner wrote: > External Email > > --- > --- > Alex Belits writes: > > On Thu, 2020-07-23 at 17:49 +0200, Peter Zijlstra wrote: > > > 'What does

Re: [PATCH v4 00/13] "Task_isolation" mode

2020-07-23 Thread Alex Belits
On Thu, 2020-07-23 at 17:49 +0200, Peter Zijlstra wrote: > > 'What does noinstr mean? and why do we have it" -- don't dare touch > the > entry code until you can answer that. noinstr disables instrumentation, so there would not be calls and dependencies on other parts of the kernel when it's not

Re: [EXT] Re: [PATCH v4 00/13] "Task_isolation" mode

2020-07-23 Thread Alex Belits
On Thu, 2020-07-23 at 17:48 +0200, Peter Zijlstra wrote: > On Thu, Jul 23, 2020 at 03:41:46PM +0000, Alex Belits wrote: > > On Thu, 2020-07-23 at 16:29 +0200, Peter Zijlstra wrote: > > > . > > > > > > This.. as presented it is an absolutely unreviewable pile o

Re: [EXT] Re: [PATCH v4 00/13] "Task_isolation" mode

2020-07-23 Thread Alex Belits
On Thu, 2020-07-23 at 16:29 +0200, Peter Zijlstra wrote: > . > > This.. as presented it is an absolutely unreviewable pile of junk. It > presents code witout any coherent problem description and analysis. > And > the patches are not split sanely either. There is a more complete and slightly outd

Re: [PATCH v4 00/13] "Task_isolation" mode

2020-07-23 Thread Alex Belits
On Thu, 2020-07-23 at 15:17 +0200, Thomas Gleixner wrote: > > Without going into details of the individual patches, let me give you a > high level view of this series: > > 1) Entry code handling: > > That's completely broken vs. the careful ordering and instrumentation > protection o

[PATCH 13/13] task_isolation: kick_all_cpus_sync: don't kick isolated cpus

2020-07-22 Thread Alex Belits
From: Yuri Norov Make sure that kick_all_cpus_sync() does not call CPUs that are running isolated tasks. Signed-off-by: Yuri Norov [abel...@marvell.com: use safe task_isolation_cpumask() implementation] Signed-off-by: Alex Belits --- kernel/smp.c | 14 +- 1 file changed, 13

[PATCH v4 12/13] task_isolation: ringbuffer: don't interrupt CPUs running isolated tasks on buffer resize

2020-07-22 Thread Alex Belits
aking] Signed-off-by: Alex Belits --- kernel/trace/ring_buffer.c | 63 ++ 1 file changed, 57 insertions(+), 6 deletions(-) diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 00867ff82412..22d4731f0def 100644 --- a/kernel/trace/ring_buf

[PATCH v4 11/13] task_isolation: net: don't flush backlog on CPUs running isolated tasks

2020-07-22 Thread Alex Belits
h, backlog flushing is enqueued only on non-isolated CPUs. Signed-off-by: Yuri Norov [abel...@marvell.com: use safe task_isolation_on_cpu() implementation] Signed-off-by: Alex Belits --- net/core/dev.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/

[PATCH v4 09/13] task_isolation: arch/arm: enable task isolation functionality

2020-07-22 Thread Alex Belits
odifications] [abel...@marvell.com: modified for kernel 5.6, added isolation cleanup] Signed-off-by: Alex Belits --- arch/arm/Kconfig | 1 + arch/arm/include/asm/barrier.h | 2 ++ arch/arm/include/asm/thread_info.h | 10 +++--- arch/arm/kernel/entry-common.S |

[PATCH v4 10/13] task_isolation: don't interrupt CPUs with tick_nohz_full_kick_cpu()

2020-07-22 Thread Alex Belits
dated, only exclude CPUs running isolated tasks] Signed-off-by: Alex Belits --- kernel/time/tick-sched.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 6e4cd8459f05..2f82a6daf8fc 100644 --- a/kernel/time/tick-sched.c

[PATCH 08/13] task_isolation: arch/arm64: enable task isolation functionality

2020-07-22 Thread Alex Belits
most call handle_domain_irq() or handle_IPI() There is a separate patch for irqchips that do not follow this rule. handle_domain_irq() -> task_isolation_kernel_enter() handle_IPI() -> task_isolation_kernel_enter() nmi_enter() -> task_isolation_kernel_enter() Signed-off-by: Chris Metca

[PATCH v4 07/13] task_isolation: arch/x86: enable task isolation functionality

2020-07-22 Thread Alex Belits
() xen_call_function_interrupt() xen_call_function_single_interrupt() xen_irq_work_interrupt() Signed-off-by: Chris Metcalf [abel...@marvell.com: adapted for kernel 5.8] Signed-off-by: Alex Belits --- arch/x86/Kconfig | 1 + arch/x86/entry/common.c| 20 +++- arch/x86

[PATCH 06/13] task_isolation: Add driver-specific hooks

2020-07-22 Thread Alex Belits
Some drivers don't call functions that call task_isolation_kernel_enter() in interrupt handlers. Call it directly. Signed-off-by: Alex Belits --- drivers/irqchip/irq-armada-370-xp.c | 6 ++ drivers/irqchip/irq-gic-v3.c| 3 +++ drivers/irqchip/irq-gic.c | 3 +++ dr

[PATCH v4 05/13] task_isolation: Add xen-specific hook

2020-07-22 Thread Alex Belits
xen_evtchn_do_upcall() should call task_isolation_kernel_enter() to indicate that isolation is broken and perform synchronization. Signed-off-by: Alex Belits --- drivers/xen/events/events_base.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/xen/events/events_base.c b/drivers

[PATCH v4 04/13] task_isolation: Add task isolation hooks to arch-independent code

2020-07-22 Thread Alex Belits
level flags handling] Signed-off-by: Alex Belits --- include/linux/hardirq.h | 2 ++ include/linux/sched.h | 2 ++ kernel/context_tracking.c | 4 kernel/irq/irqdesc.c | 13 + kernel/smp.c | 6 +- 5 files changed, 26 insertions(+), 1 deletion(-) diff -

[PATCH v4 03/13] task_isolation: userspace hard isolation from kernel

2020-07-22 Thread Alex Belits
ask corresponding to isolation bit in ll_isol_flags is visible to userspace as /sys/devices/system/cpu/isolation_running, and can be used for monitoring. Separate patches that follow provide these changes for x86, arm, and arm64 architectures, xen and irqchip drivers. Signed-off-by: Alex Belits --- ..

[PATCH v4 02/13] task_isolation: vmstat: add vmstat_idle function

2020-07-22 Thread Alex Belits
x27;t require an update. The function is called from the task-isolation code to see if we need to actually do some work to quiet vmstat. Signed-off-by: Chris Metcalf Signed-off-by: Alex Belits --- include/linux/vmstat.h | 2 ++ mm/vmstat.c| 10 ++ 2 files changed, 12 inser

[PATCH v4 01/13] task_isolation: vmstat: add quiet_vmstat_sync function

2020-07-22 Thread Alex Belits
guarantees that the vmstat worker will not run on the core on return from the function. Add a quiet_vmstat_sync() function with that semantic. Signed-off-by: Chris Metcalf Signed-off-by: Alex Belits --- include/linux/vmstat.h | 2 ++ mm/vmstat.c| 9 + 2 files changed, 11

[PATCH v4 00/13] "Task_isolation" mode

2020-07-22 Thread Alex Belits
This is a new version of task isolation implementation. Previous version is at https://lore.kernel.org/lkml/07c25c246c55012981ec0296eee23e68c719333a.ca...@marvell.com/ Mostly this covers race conditions prevention on breaking isolation. Early after kernel entry, task_isolation_enter() is called t