Re: [PATCH 4/4] um: vector: Do not use drvdata in release

2024-11-04 Thread Anton Ivanov
c @@ -815,7 +815,8 @@ static struct platform_driver uml_net_driver = { static void vector_device_release(struct device *dev) { - struct vector_device *device = dev_get_drvdata(dev); + struct vector_device *device = + container_of(dev, struct vector_device, pdev.dev);

Re: [PATCH 2/4] um: ubd: Do not use drvdata in release

2024-11-04 Thread Anton Ivanov
t ubd *ubd_dev = dev_get_drvdata(dev); + struct ubd *ubd_dev = container_of(dev, struct ubd, pdev.dev); blk_mq_free_tag_set(&ubd_dev->tag_set); *ubd_dev = ((struct ubd) DEFAULT_UBD); Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/

Re: [PATCH 1/4] um: ubd: Initialize ubd's disk pointer in ubd_add

2024-11-04 Thread Anton Ivanov
*error_out) if (err) goto out_cleanup_disk; + ubd_dev->disk = disk; + return 0; out_cleanup_disk: Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/

Re: [PATCH 3/4] um: net: Do not use drvdata in release

2024-11-04 Thread Anton Ivanov
336,7 @@ static struct platform_driver uml_net_driver = { static void net_device_release(struct device *dev) { - struct uml_net *device = dev_get_drvdata(dev); + struct uml_net *device = container_of(dev, struct uml_net, pdev.dev); struct net_device *netdev = device->dev

Re: [PATCH 1/2] vector_user: add VDE support

2024-07-30 Thread Anton Ivanov
ruct vector_fds *uml_vector_user_open( return user_init_unix_fds(parsed, ID_BESS); if (strncmp(transport, TRANS_FD, TRANS_FD_LEN) == 0) return user_init_fd_fds(parsed); + if (strncmp(transport, TRANS_VDE, TRANS_VDE_LEN) == 0) + return user_init_vde_fds(parsed); return NULL; } Acked-By: Anton Ivanov -- Anton R. Ivanov https://www.kot-begemot.co.uk/

[PATCH v2] um: vector: Fix NAPI budget handling

2024-07-06 Thread anton . ivanov
From: Anton Ivanov Fix the handling of NAPI budget. Signed-off-by: Anton Ivanov --- arch/um/drivers/vector_kern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 53e825bcc6fa..5e96efef65cf 100644 --- a

[PATCH] um: vector: Fix NAPI budget handling

2024-07-05 Thread anton . ivanov
From: Anton Ivanov Fix the handling of NAPI budget. Signed-off-by: Anton Ivanov --- arch/um/drivers/vector_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 53e825bcc6fa..18fb167e7bd8 100644 --- a

[PATCH v3] um: vector: Replace locks guarding queue depth with atomics

2024-07-05 Thread anton . ivanov
From: Anton Ivanov UML vector drivers use ring buffer structures which map preallocated skbs onto mmsg vectors for use with sendmmsg and recvmmsg. They are designed around a single consumer, single producer pattern allowing simultaneous enqueue and dequeue. Lock debugging with preemption showed

Re: [PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Anton Ivanov
On 04/07/2024 23:55, Johannes Berg wrote: On Thu, 2024-07-04 at 21:16 +0100, Anton Ivanov wrote: - qi->queue_depth = 0; + wmb(); /* Ensure that RX processing elsewhere sees the changes */ + atomic_set(&qi->queue_depth, 0); } I don't understand this. pr

Re: [PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Anton Ivanov
On 04/07/2024 17:12, Johannes Berg wrote: On Thu, 2024-07-04 at 13:22 +0100, anton.iva...@cambridgegreys.com wrote: @@ -675,11 +657,20 @@ static void prep_queue_for_rx(struct vector_queue *qi) struct vector_private *vp = netdev_priv(qi->dev); struct mmsghdr *mmsg_vector = qi->mms

[PATCH v2] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread anton . ivanov
From: Anton Ivanov UML vector drivers use ring buffer structures which map preallocated skbs onto mmsg vectors for use with sendmmsg and recvmmsg. They are designed around a single consumer, single producer pattern allowing simultaneous enqueue and dequeue. Lock debugging with preemption showed

Re: [PATCH] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Anton Ivanov
On 04/07/2024 10:55, Johannes Berg wrote: On Thu, 2024-07-04 at 10:52 +0100, Anton Ivanov wrote: There is an extra issue there - stats. I need to double-check the locking when they are being fetched. Same story - these need atomics. Otherwise we can potentially get the same ABBA lock

Re: [PATCH] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Anton Ivanov
On 04/07/2024 10:45, Anton Ivanov wrote: On 04/07/2024 10:17, Johannes Berg wrote: Hi Anton, Thanks for taking a look! Also thanks for the other explanation. On Thu, 2024-07-04 at 08:21 +0100, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov UML vector drivers use ring buffer

Re: [PATCH] um: register power-off handler

2024-07-04 Thread Anton Ivanov
On 04/07/2024 10:21, Johannes Berg wrote: On Thu, 2024-07-04 at 07:58 +0100, Anton Ivanov wrote: +__initcall(register_power_off); Anton Ivanov Heh, I thought I saw an Acked-by from you but then patchwork didn't seem to pick it up, I guess I'll treat it as one anyway? :) Yes.

Re: [PATCH] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread Anton Ivanov
On 04/07/2024 10:17, Johannes Berg wrote: Hi Anton, Thanks for taking a look! Also thanks for the other explanation. On Thu, 2024-07-04 at 08:21 +0100, anton.iva...@cambridgegreys.com wrote: From: Anton Ivanov UML vector drivers use ring buffer structures which map preallocated skbs onto

[PATCH] um: vector: Replace locks guarding queue depth with atomics

2024-07-04 Thread anton . ivanov
From: Anton Ivanov UML vector drivers use ring buffer structures which map preallocated skbs onto mmsg vectors for use with sendmmsg and recvmmsg. They are designed around a single consumer, single producer pattern allowing simultaneous enqueue and dequeue. Lock debugging with preemption showed

Re: [PATCH] um: vector: always reset vp->opened

2024-07-04 Thread Anton Ivanov
return 0; @@ -1157,7 +1159,6 @@ static int vector_net_close(struct net_device *dev) destroy_queue(vp->tx_queue); kfree(vp->fds); vp->fds = NULL; - vp->opened = false; vp->in_error = false; return 0; } Acked-By: Anton Iva

Re: [PATCH v2] um: vector: remove vp->lock

2024-07-04 Thread Anton Ivanov
or_kern.h index 2a1fa8e0f3e1..806df551be0b 100644 --- a/arch/um/drivers/vector_kern.h +++ b/arch/um/drivers/vector_kern.h @@ -71,7 +71,6 @@ struct vector_estats { struct vector_private { struct list_head list; - spinlock_t lock; struct net_device *dev; struct napi_struct napicacheline_aligned; Acked-By: Anton Ivanov -- Anton R. Ivanov https://www.kot-begemot.co.uk/

Re: [PATCH] um: register power-off handler

2024-07-03 Thread Anton Ivanov
; +} +__initcall(register_power_off); Anton Ivanov -- Anton R. Ivanov https://www.kot-begemot.co.uk/

Re: [PATCH] um: line: always fill *error_out in setup_one_line()

2024-07-03 Thread Anton Ivanov
up_one_line(struct line *lines, int n, char *init, } } if (err) { + *error_out = "failed to parse channel pair"; line->init_str = NULL; line->valid = 0;

Re: [PATCH] um: remove pcap driver from documentation

2024-07-03 Thread Anton Ivanov
| ~ 500Mbit | Acked-By: Anton Ivanov -- Anton R. Ivanov https://www.kot-begemot.co.uk/

Re: vector: spinlock ordering problems

2024-07-03 Thread Anton Ivanov
On 03/07/2024 17:26, Johannes Berg wrote: Lockdep reports a spinlock ordering problem: sometimes we take head_lock first, sometimes tail_lock, so there's a classic ABBA deadlock possible. It may not happen now because of UML being single-CPU and all that, but perhaps with preempt? You need both

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&#

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

[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 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 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 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] 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 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

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: 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 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: [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: [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: [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: 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: 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: [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: [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] 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 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: 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 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: [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

[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] 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

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

[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: [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

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-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-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-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
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: [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: [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 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 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 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 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

[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 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

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: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 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 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 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 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: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

[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 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

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

[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 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 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

[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

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

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 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: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

[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] 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

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: 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-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: [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: 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: 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

  1   2   >