Re: Add linux-um archives to lore.kernel.org?

2022-10-13 Thread Anton Ivanov
On 12/10/2022 20:15, Johannes Berg wrote: On Wed, 2022-10-12 at 14:11 -0500, Bjorn Helgaas wrote: The linux-um@lists.infradead.org mailing list is listed in MAINTAINERS and is quite active [1]. Once in a while a commit links to the infradead pipermail archive [2] (the link in that commit app

Re: [PATCH] um: protect VMA iteration

2022-10-17 Thread Anton Ivanov
struct *vma; VMA_ITERATOR(vmi, mm, 0); + rcu_read_lock(); for_each_vma(vmi, vma) fix_range(mm, vma->vm_start, vma->vm_end, 1); + rcu_read_unlock(); } Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Numb

Re: [PATCH v3] um: protect VMA iteration

2022-10-18 Thread Anton Ivanov
tlb.c @@ -597,6 +597,8 @@ void force_flush_all(void) struct vm_area_struct *vma; VMA_ITERATOR(vmi, mm, 0); + mmap_read_lock(mm); for_each_vma(vmi, vma) fix_range(mm, vma->vm_start, vma->vm_end, 1); + mmap_read_unlock(mm); } Acked-By: Ant

Re: [PATCH -next] um: vector: Fix memory leak in vector_config

2022-11-16 Thread Anton Ivanov
*error_out) if (parsed == NULL) { *error_out = "vector_config failed to parse parameters"; + kfree(params); return -EINVAL; } Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company N

Re: [PATCH] um: vector: Fix memory leak in vector_config

2023-01-03 Thread Anton Ivanov
On 03/01/2023 08:00, Geert Uytterhoeven wrote: Hi Miaoqian, On Thu, Dec 29, 2022 at 8:53 AM Miaoqian Lin wrote: kstrdup() return newly allocated copy of the string. Call kfree() to release the memory when after use. Fixes: 49da7e64f33e ("High Performance UML Vector Network Driver") Signed-o

Re: [PATCH v2] um: vector: Fix memory leak in vector_config

2023-01-04 Thread Anton Ivanov
um/drivers/vector_kern.c @@ -767,6 +767,7 @@ static int vector_config(char *str, char **error_out) if (parsed == NULL) { *error_out = "vector_config failed to parse parameters"; + kfree(params); return -EINVAL; } Acked-By: Anton

Re: Using ftrace

2023-01-30 Thread Anton Ivanov
On 31/01/2023 04:17, Glenn Washburn wrote: I'm trying to use the ftrace facility within UML. It appears as though it exists in the menuconfig, but I can't seem to get the kernel to recognize the tracefs filesystem. I'm wondering if someone can confirm that either ftrace does or does not work in U

Re: Using ftrace

2023-01-31 Thread Anton Ivanov
On 31/01/2023 09:10, Johannes Berg wrote: On Tue, 2023-01-31 at 08:22 +0100, Richard Weinberger wrote: Adding function (and function graph) tracing to UML is possible but a bit of work. You need to find a way to implement all of ftraces mcount hooks for UML. It feels like it shouldn't be th

Re: [PATCH] uml: vector: fix definitios of VECTOR_WRITE and VECTOR_HEADERS

2023-02-09 Thread Anton Ivanov
On 09/02/2023 16:19, Carlos Bilbao wrote: Fix definitions of VECTOR_WRITE and VECTOR_HEADERS with proper bitwise operand for bit shift. Signed-off-by: Carlos Bilbao --- arch/um/drivers/vector_user.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/vecto

Re: [PATCH] uml: vector: fix definitios of VECTOR_WRITE and VECTOR_HEADERS

2023-02-09 Thread Anton Ivanov
On 09/02/2023 16:19, Carlos Bilbao wrote: Fix definitions of VECTOR_WRITE and VECTOR_HEADERS with proper bitwise operand for bit shift. Signed-off-by: Carlos Bilbao --- arch/um/drivers/vector_user.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/vecto

Re: [PATCH] uml: vector: Remove unused definitions VECTOR_{WRITE,HEADERS}

2023-02-09 Thread Anton Ivanov
rglist *uml_parse_vector_ifspec(char *arg); Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/ ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infrade

Re: UML for arm64

2023-06-23 Thread Anton Ivanov
On 22/06/2023 21:13, Benjamin Berg wrote: Hi, On Thu, 2023-06-22 at 21:41 +0200, Johannes Berg wrote: On Thu, 2023-06-22 at 13:22 -0600, Rob Herring wrote: I'm interested in getting UML working on Arm. Is anyone aware of any efforts to do this already? Not me ... But yeah, agree that it s

Re: [PATCH v1] drivers: use free_netdev before return

2023-07-03 Thread Anton Ivanov
On 03/07/2023 10:41, Minjie Du wrote: We fixed a bug where the variable dev was not freed before return. Signed-off-by: Minjie Du --- arch/um/drivers/vector_kern.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 131b7

Re: [PATCH v2] drivers: use free_netdev before return

2023-07-03 Thread Anton Ivanov
out_free_netdev: free_netdev(dev); out_free_device: Acked-By: "Anton Ivanov" -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/ ___ linux-um mailing list linux-um

Re: [PATCH] um: vector: refactor deprecated strncpy

2023-08-07 Thread Anton Ivanov
ers-ad44050885d0 Best regards, -- Justin Stitt ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um Acked-by: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company

Re: [PATCH v4] um: vector: Fix exception handling in vector_eth_configure()

2023-08-21 Thread Anton Ivanov
On 19/08/2023 22:01, Richard Weinberger wrote: - Ursprüngliche Mail - The resource cleanup was incomplete in the implementation of the function "vector_eth_configure". Thus replace the jump target "out_undo_user_init" by "out_free_netdev". Delate the orphan function "out_undo_user_init

Re: Arches that don't support PREEMPT

2023-09-19 Thread Anton Ivanov
On 19/09/2023 14:42, Peter Zijlstra wrote: On Tue, Sep 19, 2023 at 03:37:24PM +0200, John Paul Adrian Glaubitz wrote: On Tue, 2023-09-19 at 14:00 +0100, Matthew Wilcox wrote: On Tue, Sep 19, 2023 at 02:30:59PM +0200, Thomas Gleixner wrote: Though it just occured to me that there are dragons

Re: Arches that don't support PREEMPT

2023-09-19 Thread Anton Ivanov
On 19/09/2023 16:17, Thomas Gleixner wrote: On Tue, Sep 19 2023 at 15:21, Anton Ivanov wrote: On 19/09/2023 14:42, Peter Zijlstra wrote: If you're working on one of them, then surely it's a simple matter of working on adding CONFIG_PREEMPT support :-) In the case of UML adding pr

Re: Arches that don't support PREEMPT

2023-09-19 Thread Anton Ivanov
On 19/09/2023 17:22, Richard Weinberger wrote: - Ursprüngliche Mail - Von: "anton ivanov" It's been a while. I remember that I dropped it at the time, but do not remember the full details. There was some stuff related to FP state and a few other issues I ran into whil

Boots and seems to work with PREEMPT enabled

2023-09-20 Thread Anton Ivanov
Added support for kernel side fpu store/restore and real kernel_fpu_begin/kernel_fpu_end using gcc intrinsics. Enabled PREEMPT. It boots and seems to be alive and kicking. I do not notice any significant effect on performance either. How do I test it from here onwards? I am happy to throw the

Re: Boots and seems to work with PREEMPT enabled

2023-09-20 Thread Anton Ivanov
On 20/09/2023 12:14, Anton Ivanov wrote: Added support for kernel side fpu store/restore and real kernel_fpu_begin/kernel_fpu_end using gcc intrinsics. Enabled PREEMPT. It boots and seems to be alive and kicking. I do not notice any significant effect on performance either. I take my

[PATCH] um: Enable preemption in UML

2023-09-20 Thread anton . ivanov
From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton Ivanov --- arch/um/Kconfig | 1 - arch/um/Makefile| 3 +- arch/um/include/asm/fpu/api.h | 4

Re: Boots and seems to work with PREEMPT enabled

2023-09-20 Thread Anton Ivanov
On 20/09/2023 13:30, Anton Ivanov wrote: On 20/09/2023 12:14, Anton Ivanov wrote: Added support for kernel side fpu store/restore and real kernel_fpu_begin/kernel_fpu_end using gcc intrinsics. Enabled PREEMPT. It boots and seems to be alive and kicking. I do not notice any significant

Re: Arches that don't support PREEMPT

2023-09-20 Thread Anton Ivanov
On 19/09/2023 15:16, Peter Zijlstra wrote: On Tue, Sep 19, 2023 at 03:48:09PM +0200, John Paul Adrian Glaubitz wrote: On Tue, 2023-09-19 at 15:42 +0200, Peter Zijlstra wrote: The agreement to kill off ia64 wasn't an invitation to kill off other stuff that people are still working on! Can we

Re: [PATCH] um: Enable preemption in UML

2023-09-20 Thread Anton Ivanov
On 20/09/2023 15:49, Peter Lafreniere wrote: On Wed, Sep 20, 2023 at 08:31, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov anton.iva...@cambridgegreys.com Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton

Re: [PATCH] um: Enable preemption in UML

2023-09-20 Thread Anton Ivanov
On 20/09/2023 16:04, Peter Lafreniere wrote: On Wed, Sep 20, 2023 at 08:31, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov anton.iva...@cambridgegreys.com Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton

Re: Boots and seems to work with PREEMPT enabled

2023-09-20 Thread Anton Ivanov
On 20/09/2023 13:30, Anton Ivanov wrote: On 20/09/2023 12:14, Anton Ivanov wrote: Added support for kernel side fpu store/restore and real kernel_fpu_begin/kernel_fpu_end using gcc intrinsics. Enabled PREEMPT. It boots and seems to be alive and kicking. I do not notice any significant

Re: [PATCH] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 20/09/2023 15:49, Peter Lafreniere wrote: On Wed, Sep 20, 2023 at 08:31, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov anton.iva...@cambridgegreys.com Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton

Re: [PATCH] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 08:30, Richard Weinberger wrote: - Ursprüngliche Mail - Von: "anton ivanov" An: "Peter Lafreniere" CC: "Johannes Berg" , "linux-um" , "richard" Gesendet: Donnerstag, 21. September 2023 09:12:33 Betreff: Re: [PATCH

[PATCH v2] um: Enable preemption in UML

2023-09-21 Thread anton . ivanov
From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton Ivanov --- arch/um/Kconfig | 1 - arch/um/Makefile| 3 +- arch/um/include/asm/fpu/api.h | 4

Re: [PATCH v2] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 10:28, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Marginally slower than before 3m 03s for find /usr -type f -exec cat {} > /dev/null \; Still, better t

Re: [PATCH v2] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 10:35, Johannes Berg wrote: Hi, Haven't chimed in here before, but thanks for looking at this! I actually really wanted at least the things you get for debug from this in the past, so much appreciated. I think I actually tried a simpler approach and it kind of even worked, but

Re: [PATCH v2] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 10:42, Anton Ivanov wrote: On 21/09/2023 10:35, Johannes Berg wrote: Hi, Haven't chimed in here before, but thanks for looking at this! I actually really wanted at least the things you get for debug from this in the past, so much appreciated. I think I actually tr

Re: [PATCH v2] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 14:46, Peter Lafreniere wrote: On Thu, Sep 21, 2023 at 05:28, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov anton.iva...@cambridgegreys.com Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton

Re: [PATCH v2] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 14:46, Peter Lafreniere wrote: On Thu, Sep 21, 2023 at 05:28, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov anton.iva...@cambridgegreys.com Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton

[PATCH] um: Fix naming clash between UML and scheduler

2023-09-21 Thread anton . ivanov
From: Anton Ivanov __cant_sleep was already used and exported by the scheduler. The name had to be changed to a UML specific one. Signed-off-by: Anton Ivanov --- arch/um/include/shared/kern_util.h | 2 +- arch/um/kernel/process.c | 2 +- arch/um/os-Linux/helper.c | 6

[PATCH v3] um: Enable preemption in UML

2023-09-21 Thread anton . ivanov
From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton Ivanov --- arch/um/Kconfig | 1 - arch/um/include/asm/fpu/api.h | 6 +- arch/um/include/asm/processor-generic.h | 3

Re: [PATCH v3] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 16:42, Peter Lafreniere wrote: On Thu, Sep 21, 2023 at 11:32, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov anton.iva...@cambridgegreys.com Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton

[PATCH v4] um: Enable preemption in UML

2023-09-21 Thread anton . ivanov
From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton Ivanov --- arch/um/Kconfig | 1 - arch/um/include/asm/fpu/api.h | 9 ++- arch/um/include/asm/processor-generic.h

Re: [PATCH v4] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 16:55, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton Ivanov --- arch/um/Kconfig | 1 - arch/um/include/asm/fpu

Re: [PATCH v3] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 16:32, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton Ivanov --- arch/um/Kconfig | 1 - arch/um/include/asm/fpu

Re: [PATCH v4] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 22:02, Richard Weinberger wrote: - Ursprüngliche Mail - Von: "anton ivanov" An: "linux-um" CC: "Johannes Berg" , "richard" , "anton ivanov" Gesendet: Donnerstag, 21. September 2023 17:55:22 Betreff: [PATCH v

Re: [PATCH v4] um: Enable preemption in UML

2023-09-21 Thread Anton Ivanov
On 21/09/2023 22:55, Richard Weinberger wrote: - Ursprüngliche Mail - Von: "anton ivanov" An: "richard" CC: "linux-um" , "Johannes Berg" Gesendet: Donnerstag, 21. September 2023 23:41:16 Betreff: Re: [PATCH v4] um: Enable preemption in UML

[PATCH v5] um: Enable preemption in UML

2023-09-21 Thread anton . ivanov
From: Anton Ivanov Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics. Signed-off-by: Anton Ivanov --- arch/um/Kconfig | 1 - arch/um/include/asm/fpu/api.h | 9 ++- arch/um/include/asm/processor-generic.h

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 08:27, Richard Weinberger wrote: - Ursprüngliche Mail - Von: "anton ivanov" An: "linux-um" CC: "Johannes Berg" , "richard" , "anton ivanov" Gesendet: Freitag, 22. September 2023 08:52:12 Betreff: [PATCH v5] um: Enable

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 08:30, Johannes Berg wrote: On Fri, 2023-09-22 at 07:52 +0100, anton.iva...@cambridgegreys.com wrote: +++ b/arch/um/include/asm/processor-generic.h @@ -44,6 +44,9 @@ struct thread_struct { } cb; } u; } request; +#if defined(CONFIG_P

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 08:40, Johannes Berg wrote: On Fri, 2023-09-22 at 08:38 +0100, Anton Ivanov wrote: I had enabled CONFIG_DEBUG_ATOMIC_SLEEP because that's actually something I'd really like to have in our testing. But with that issue I don't even know how we get there really.

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 09:13, Johannes Berg wrote: On Fri, 2023-09-22 at 09:01 +0100, Anton Ivanov wrote: My favorite test which I run on all changes is: find /usr -type f -exec cat {} > /dev/null \; On Debian this forks /bin/cat for each file and does IO on it. That test passes here every t

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 09:41, Johannes Berg wrote: Yes, but when does the fork actually happen? Looking further at this, now I'm confused as to why it doesn't happen _all_ the time. I think this has pretty much always been wrong, just now we actually notice it? Basically, when we create a new thread

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 10:04, Johannes Berg wrote: On Fri, 2023-09-22 at 10:43 +0200, Johannes Berg wrote: I think this has pretty much always been wrong, just now we actually notice it? Basically, when we create a new thread (really just mm I think), we say the first thing that has to run there is for

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 10:14, Johannes Berg wrote: On Fri, 2023-09-22 at 11:10 +0200, Johannes Berg wrote: On Fri, 2023-09-22 at 10:06 +0100, Anton Ivanov wrote: On 22/09/2023 09:41, Johannes Berg wrote: Yes, but when does the fork actually happen? Looking further at this, now I'm confused

Re: [PATCH v5] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 10:55, Johannes Berg wrote: On Fri, 2023-09-22 at 11:51 +0200, Johannes Berg wrote: On Fri, 2023-09-22 at 10:19 +0100, Anton Ivanov wrote: So maybe that works - perhaps with a big comment? Ack. Will add this to the patch and run it through its paces. We can also just get rid

[PATCH v6] um: Enable preemption in UML

2023-09-22 Thread anton . ivanov
From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. 2. irq critical sections need preempt_disable()/preempt_enable(). 3. TLB critical sections need

Re: [PATCH v6] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 11:56, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. 2. irq critical sections need preempt_disable

Re: [PATCH v6] um: Enable preemption in UML

2023-09-22 Thread Anton Ivanov
On 22/09/2023 12:22, Johannes Berg wrote: 4. UML TLB flush is also invoked during a fork. This happens with interrupts and preempt disabled which disagrees with the standard mm locking via rwsem. The mm lock for this code path had to be replaced with an rcu. For the record, even if I figure

Re: [PATCH] um: clean up mm creation

2023-09-22 Thread Anton Ivanov
On 22/09/2023 12:16, Johannes Berg wrote: From: Johannes Berg While enabling PREEMPT on UML, we found that the call to force_flush_all() cannot be done where it is, it sleeps while atomic. Further investigation shows that all this seems at least a bit roundabout and possibly wrong wrong in t

Re: [PATCH] um: clean up mm creation

2023-09-22 Thread Anton Ivanov
On 22/09/2023 16:31, Benjamin Berg wrote: Hi, On Fri, 2023-09-22 at 14:41 +0100, Anton Ivanov wrote: On 22/09/2023 12:16, Johannes Berg wrote: From: Johannes Berg While enabling PREEMPT on UML, we found that the call to force_flush_all() cannot be done where it is, it sleeps while atomic

Re: [PATCH] um: clean up mm creation

2023-09-22 Thread Anton Ivanov
On 22/09/2023 20:41, Johannes Berg wrote: On Fri, 2023-09-22 at 14:41 +0100, Anton Ivanov wrote: It is nearly twice slower than the current approach on a find /usr -type f -exec cat {} > /dev/null \; Btw, I cannot reproduce that at all - seems about the same in my tests? Is there anyth

Re: [PATCH] um: clean up mm creation

2023-09-22 Thread Anton Ivanov
On 22/09/2023 21:12, Johannes Berg wrote: On Fri, 2023-09-22 at 21:08 +0100, Anton Ivanov wrote: On 22/09/2023 20:41, Johannes Berg wrote: On Fri, 2023-09-22 at 14:41 +0100, Anton Ivanov wrote: It is nearly twice slower than the current approach on a find /usr -type f -exec cat {} > /

Re: [PATCH] um: clean up mm creation

2023-09-22 Thread Anton Ivanov
On 22/09/2023 21:12, Johannes Berg wrote: On Fri, 2023-09-22 at 21:08 +0100, Anton Ivanov wrote: On 22/09/2023 20:41, Johannes Berg wrote: On Fri, 2023-09-22 at 14:41 +0100, Anton Ivanov wrote: It is nearly twice slower than the current approach on a find /usr -type f -exec cat {} > /

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2023-09-25 Thread Anton Ivanov
I have rebased the preempt patch on top of these series. PREEMPT works with some performance decrease. VOLUNTARY deadlocks early in boot around the time it starts loading modules. non-preemptible deadlocks very early in boot. I am going to investigate and come back with a revised PREEMPT patch

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2023-09-25 Thread Anton Ivanov
On 25/09/2023 14:33, Johannes Berg wrote: On Mon, 2023-09-25 at 14:29 +0100, Anton Ivanov wrote: I have rebased the preempt patch on top of these series. PREEMPT works with some performance decrease. VOLUNTARY deadlocks early in boot around the time it starts loading modules. non

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2023-09-25 Thread Anton Ivanov
On 25/09/2023 14:33, Johannes Berg wrote: On Mon, 2023-09-25 at 14:29 +0100, Anton Ivanov wrote: I have rebased the preempt patch on top of these series. PREEMPT works with some performance decrease. VOLUNTARY deadlocks early in boot around the time it starts loading modules. non

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2023-09-25 Thread Anton Ivanov
On 25/09/2023 15:44, Johannes Berg wrote: On Mon, 2023-09-25 at 15:27 +0100, Anton Ivanov wrote: On 25/09/2023 14:33, Johannes Berg wrote: On Mon, 2023-09-25 at 14:29 +0100, Anton Ivanov wrote: I have rebased the preempt patch on top of these series. PREEMPT works with some performance

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2023-09-26 Thread Anton Ivanov
On 25/09/2023 16:20, Anton Ivanov wrote: On 25/09/2023 15:44, Johannes Berg wrote: On Mon, 2023-09-25 at 15:27 +0100, Anton Ivanov wrote: On 25/09/2023 14:33, Johannes Berg wrote: On Mon, 2023-09-25 at 14:29 +0100, Anton Ivanov wrote: I have rebased the preempt patch on top of these

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2023-09-26 Thread Anton Ivanov
On 26/09/2023 13:38, Johannes Berg wrote: On Tue, 2023-09-26 at 13:16 +0100, Anton Ivanov wrote: For the time being it is mostly negative :) Oh well :) 1. The performance after the mm patch is down. By 30-40% on my standard bench. For the record, you mean this three-patch series that

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2023-09-27 Thread Anton Ivanov
On 27/09/2023 10:52, Benjamin Berg wrote: Hi, On Tue, 2023-09-26 at 14:38 +0200, Johannes Berg wrote: [SNIP] 1. Start from scratch, without copying, which my other patch [1] did. I really think we should go ahead with that approach. Then follow up with optimizations. +1 [SNIP] I thin

[PATCH v7] um: Enable preemption in UML

2023-09-28 Thread anton . ivanov
From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. We reuse the space which is already allocated for the userspace threads in the thread_info structure. 2. irq

Re: [PATCH v7] um: Enable preemption in UML

2023-09-28 Thread Anton Ivanov
On 28/09/2023 10:10, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. We reuse the space which is already allocated

Re: [PATCH] um: vector: fix return value check in vector_mmsg_rx

2023-10-06 Thread Anton Ivanov
On 07/10/2023 01:51, Ma Ke wrote: In vector_mmsg_rx, to avoid an unexpected result returned by pskb_trim, we should check the return value of pskb_trim(). Signed-off-by: Ma Ke --- arch/um/drivers/vector_kern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/dr

[PATCH] um: document arch_futex_atomic_op_inuser

2023-10-17 Thread anton . ivanov
From: Anton Ivanov arch_futex_atomic_op_inuser was not documented correctly resulting in build time warnings. Signed-off-by: Anton Ivanov --- arch/um/kernel/skas/uaccess.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/um/kernel/skas/uaccess.c b/arch/um/kernel

Re: [PATCH 1/4] um: irqs: process outstanding IRQs when unblocking signals

2023-10-20 Thread Anton Ivanov
On 20/10/2023 10:15, Benjamin Beichler wrote: Am 18.10.2023 um 14:36 schrieb benja...@sipsolutions.net: From: Benjamin Berg When in time-travel mode, the eventfd events are read even when signals are blocked as SIGIO still needs to be processed. In this case, the event is cleared on the eve

Re: [PATCH RFC 11/11] um: Remove all TSC flags when using Time Travel Mode

2023-11-03 Thread Anton Ivanov
strstr(line, x86_cap_flags[i]) && + !(time_travel_mode != TT_MODE_OFF && strstr("tsc", x86_cap_flags[i]))) set_cpu_cap(&boot_cpu_data, i); } } Acked-by: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in Engl

Re: Missing clobber on alternative use on Linux UM 32-bit

2023-11-04 Thread Anton Ivanov
On 04/11/2023 09:25, Nadav Amit wrote: I was reading (again) the x86 C macro of “alternative()” and I was a bit surprised it does clobber the flags (“cc”) as a precaution. #define alternative(oldinstr, newinstr, ft_flags) \ asm_inline volatile (ALTERNATIVE(oldinstr, newinstr, ft_flags

Re: [PATCH] um: hostfs: catch EINTR and partial read/write

2023-11-10 Thread Anton Ivanov
On 10/11/2023 09:44, benja...@sipsolutions.net wrote: From: Benjamin Berg The UM kernel uses signals for various purposes (SIGALRM for scheduling for example). These signals are interrupts for the UM kernel, which should not affect file system operations from userspace processes. Said diffe

Re: [PATCH] um: hostfs: catch EINTR and partial read/write

2023-11-10 Thread Anton Ivanov
On 10/11/2023 10:42, Anton Ivanov wrote: On 10/11/2023 09:44, benja...@sipsolutions.net wrote: From: Benjamin Berg The UM kernel uses signals for various purposes (SIGALRM for scheduling for example). These signals are interrupts for the UM kernel, which should not affect file system

Re: [PATCH] um: hostfs: catch EINTR and partial read/write

2023-11-10 Thread Anton Ivanov
On 10/11/2023 11:10, Benjamin Berg wrote: Hi, On Fri, 2023-11-10 at 10:56 +, Anton Ivanov wrote: On 10/11/2023 10:42, Anton Ivanov wrote: [SNIP] If we are going to use this definition of CATCH_EINTR throughout we might as well remove the partial read/write code in UBD and other places

Re: [PATCH 3/4] um: add mmap/mremap/munmap OS calls

2023-11-10 Thread Anton Ivanov
On 10/11/2023 18:52, Johannes Berg wrote: From: Johannes Berg For the upcoming shared-memory time-travel external optimisations, we need to be able to mmap/mremap (and on error munmap). Add the necessary OS calls. Signed-off-by: Johannes Berg --- arch/um/include/shared/os.h | 3 +++ arch/

Re: jitterentropy vs. simulation

2023-12-01 Thread Anton Ivanov
On 01/12/2023 10:21, Johannes Berg wrote: Hi, In ARCH=um, we have a mode where we simulate clocks completely, and even simulate that the CPU is infinitely fast. Thus, reading the clock will return completely predictable values regardless of the work happening. This is clearly incompatible wi

Re: jitterentropy vs. simulation

2023-12-04 Thread Anton Ivanov
On 04/12/2023 12:06, Benjamin Beichler wrote: Am 01.12.2023 um 19:35 schrieb Johannes Berg: [I guess we should keep the CCs so other see it] Looking at the stuck check it will be bogus in simulations. True. You might as well ifdef that instead. If a simulation is running insert the ent

Re: [PATCH] um: net: Fix return type of uml_net_start_xmit()

2023-12-05 Thread Anton Ivanov
ic netdev_tx_t uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct uml_net_private *lp = netdev_priv(dev); unsigned long flags; --- base-commit: 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa change-id: 20231003-um-net-wifpts-14a7429c7524 Best regards, -- Natha

Re: [PATCH] um: vector: fix return value check in vector_legacy_rx

2024-01-05 Thread Anton Ivanov
On 05/01/2024 08:42, Johannes Berg wrote: On Thu, 2024-01-04 at 22:05 +0100, Richard Weinberger wrote: On Fri, Oct 6, 2023 at 2:28 PM Ma Ke wrote: In vector_legacy_rx, to avoid an unexpected result returned by pskb_trim, we should check the return value of pskb_trim(). Signed-off-by: Ma Ke

Re: [RFC PATCH 0/3] um: clean up mm creation - another attempt

2024-01-17 Thread Anton Ivanov
On 17/01/2024 17:17, Benjamin Berg wrote: Hi, On Wed, 2023-09-27 at 11:52 +0200, Benjamin Berg wrote: [SNIP] Once we are there, we can look for optimizations. The fundamental problem is that page faults (even minor ones) are extremely expensive for us. Just throwing out ideas on what we could

Re: pcap-dbus.o:undefined reference to `dbus_message_demarshal'

2024-03-07 Thread Anton Ivanov
On 06/03/2024 16:14, Waqar Hameed wrote: On Tue, Mar 05, 2024 at 23:11 +0800 kernel test robot wrote: Hi Vincent, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 90d35da658da8cff0d4ecbb5113f5fac9d00eb72 commi

Re: pcap-dbus.o:undefined reference to `dbus_message_demarshal'

2024-03-07 Thread Anton Ivanov
On 07/03/2024 10:03, Johannes Berg wrote: On Thu, 2024-03-07 at 09:54 +, Anton Ivanov wrote: PCAP is not feasible to incorporate into the build system at present. It has grown all kinds of warts over the years and brings a lot of dependencies. IMHO we should remove it from the tree. It

Re: pcap-dbus.o:undefined reference to `dbus_message_demarshal'

2024-03-07 Thread Anton Ivanov
On 07/03/2024 10:29, Johannes Berg wrote: On Thu, 2024-03-07 at 10:27 +, Anton Ivanov wrote: How's that required to be formatted and loaded? tcpdump itself can also dump the filter in BPF format, with -d/-ddd (-dd is a C representation, so probably not useful). Perhaps we could

Re: [PATCH RESEND 1/1] um: oops on accessing a non-present page in the vmalloc area

2024-03-20 Thread Anton Ivanov
On 20/03/2024 14:09, Richard Weinberger wrote: - Ursprüngliche Mail - Von: "Petr Tesarik" Yes. I'm just way behind my maintainer schedule. :-/ Understood. Thank you for your reply. By the way, are you looking for more people to help with the amount of work? Yes, help is always

[PATCH] um: Remove obsolete pcap driver

2024-03-28 Thread anton . ivanov
From: Anton Ivanov Remove the pcap driver in UML. It is obsolete. It does not build on recent systems due to changes in libpcap and its dependencies. The vector driver's raw transport in UML provides identical functionality. Signed-off-by: Anton Ivanov --- arch/um/drivers/Kconfig

Re: [PATCH v7] um: Enable preemption in UML

2024-03-28 Thread Anton Ivanov
On 28/03/2024 09:27, Johannes Berg wrote: @@ -23,7 +23,7 @@ struct thread_info { int preempt_count; /* 0 => preemptable, <0 => BUG */ struct thread_info *real_thread;/* Points to non-IRQ stack */

[PATCH v8] um: Enable preemption in UML

2024-03-28 Thread anton . ivanov
From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. We reuse the space which is already allocated for the userspace threads in the thread_info structure. 2. irq

Re: [PATCH v8] um: Enable preemption in UML

2024-04-01 Thread Anton Ivanov
On 01/04/2024 12:04, Tiwei Bie wrote: On 3/29/24 3:50 AM, anton.iva...@cambridgegreys.com wrote: [...] + +void kernel_fpu_begin(void) +{ + preempt_disable(); + + WARN_ON(this_cpu_read(in_kernel_fpu)); + + this_cpu_write(in_kernel_fpu, true); + +#ifdef CONFIG_64BIT + if (l

[PATCH v9] um: Enable preemption in UML

2024-04-02 Thread anton . ivanov
From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. We reuse the space which is already allocated for the userspace threads in the thread_info structure. 2. irq

Re: [PATCH v9] um: Enable preemption in UML

2024-04-20 Thread Anton Ivanov
On 19/04/2024 14:47, Benjamin Berg wrote: Hi, On Wed, 2024-04-03 at 07:27 +0100, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread

Re: [PATCH 12/12] um: refactor TLB update handling

2024-04-22 Thread Anton Ivanov
On 22/04/2024 08:22, Benjamin Berg wrote: On Mon, 2024-04-22 at 10:51 +0800, Tiwei Bie wrote: On 4/18/24 5:23 PM, benja...@sipsolutions.net wrote: diff --git a/arch/um/include/asm/mmu.h b/arch/um/include/asm/mmu.h index 37eb6e89e79a..bf8da736609c 100644 --- a/arch/um/include/asm/mmu.h +++ b/

Re: [PATCH 02/14] ubd: untagle discard vs write zeroes not support handling

2024-06-14 Thread Anton Ivanov
lk_queue_max_write_zeroes_sectors(io_req->req->q, 0); } blk_mq_end_request(io_req->req, io_req->error); kfree(io_req); Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/

Re: [PATCH 01/14] ubd: refactor the interrupt handler

2024-06-14 Thread Anton Ivanov
amp;& len != -EAGAIN) + pr_err("spurious interrupt in %s, err = %d\n", __func__, len); return IRQ_HANDLED; } Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/

Re: [PATCH v9] um: Enable preemption in UML

2024-07-01 Thread Anton Ivanov
On 01/07/2024 20:09, Johannes Berg wrote: On Mon, 2024-07-01 at 19:55 +0100, Anton Ivanov wrote: As Benjamin pointed out we no longer need this, so we can junk this patch at this point. If there will be any need to save/restore FPU in kernel context, I will revisit it. I think we still want

Re: [PATCH v9] um: Enable preemption in UML

2024-07-01 Thread Anton Ivanov
On 01/07/2024 17:35, Johannes Berg wrote: On Mon, 2024-07-01 at 17:56 +0200, Johannes Berg wrote: Hmm. I also see a ton of this: BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1525 in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 538, name: chan-switch.sh pr

Re: [PATCH v10] um: Enable preemption in UML

2024-07-02 Thread Anton Ivanov
On 02/07/2024 09:25, Johannes Berg wrote: From: Anton Ivanov Since userspace state is saved in the MM process, kernel using FPU still doesn't really need to do anything, so this really is as simple as enabling preemption. The irq critical section in sigio_handler() needs preempt_di

Re: [PATCH v10] um: Enable preemption in UML

2024-07-02 Thread Anton Ivanov
On 02/07/2024 11:18, Johannes Berg wrote: On Tue, 2024-07-02 at 11:07 +0100, Anton Ivanov wrote: Is that all we have left? I think so, yes. I lost track of your mm patches and they do not apply cleanly to master at present. Mine actually mostly went away, in favour of Benjamin&#

  1   2   >