Re: [PATCH] Updates to Xen hypercall preemption

2023-06-24 Thread Andy Lutomirski
On Thu, Jun 22, 2023, at 10:20 AM, Juergen Gross wrote: > On 22.06.23 18:39, Andy Lutomirski wrote: >> On Thu, Jun 22, 2023, at 3:33 AM, Juergen Gross wrote: >>> On 22.06.23 10:26, Peter Zijlstra wrote: On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: > The hypercalls we

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Juergen Gross
On 22.06.23 18:39, Andy Lutomirski wrote: On Thu, Jun 22, 2023, at 3:33 AM, Juergen Gross wrote: On 22.06.23 10:26, Peter Zijlstra wrote: On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: The hypercalls we are talking of are synchronous ones. They are running in the context of th

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Andy Lutomirski
On Thu, Jun 22, 2023, at 3:33 AM, Juergen Gross wrote: > On 22.06.23 10:26, Peter Zijlstra wrote: >> On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: >> >>> The hypercalls we are talking of are synchronous ones. They are running >>> in the context of the vcpu doing the call (like a s

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Juergen Gross
On 22.06.23 15:05, Andrew Cooper wrote: On 22/06/2023 9:26 am, Peter Zijlstra wrote: On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: The hypercalls we are talking of are synchronous ones. They are running in the context of the vcpu doing the call (like a syscall from userland is

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 02:05:13PM +0100, Andrew Cooper wrote: > On 22/06/2023 9:26 am, Peter Zijlstra wrote: > > On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: > > > >> The hypercalls we are talking of are synchronous ones. They are running > >> in the context of the vcpu doing the

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Andrew Cooper
On 22/06/2023 9:26 am, Peter Zijlstra wrote: > On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: > >> The hypercalls we are talking of are synchronous ones. They are running >> in the context of the vcpu doing the call (like a syscall from userland is >> running in the process context)

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Juergen Gross
On 22.06.23 13:15, Peter Zijlstra wrote: On Thu, Jun 22, 2023 at 12:33:31PM +0200, Juergen Gross wrote: On 22.06.23 10:26, Peter Zijlstra wrote: The downside would be that some workloads might see worse performance due to backend I/O handling might get preempted. Is that an actual concern?

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 12:33:31PM +0200, Juergen Gross wrote: > On 22.06.23 10:26, Peter Zijlstra wrote: > > > The downside would be that some workloads might see worse performance > > > due to backend I/O handling might get preempted. > > > > Is that an actual concern? Mark this a legaxy intefa

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Juergen Gross
On 22.06.23 10:26, Peter Zijlstra wrote: On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: The hypercalls we are talking of are synchronous ones. They are running in the context of the vcpu doing the call (like a syscall from userland is running in the process context). (so time

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Per Bilse
On 6/21/2023 9:04 PM, Peter Zijlstra wrote: > On Wed, Jun 21, 2023 at 07:19:21PM +, Per Bilse wrote: >> On 6/21/2023 5:40 PM, Peter Zijlstra wrote: >>> I don't understand it -- fundamentally, how can linux schedule when the >>> guest isn't even running? Hypercall transfers control to the >>> ho

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-22 Thread Peter Zijlstra
On Thu, Jun 22, 2023 at 07:22:53AM +0200, Juergen Gross wrote: > The hypercalls we are talking of are synchronous ones. They are running > in the context of the vcpu doing the call (like a syscall from userland is > running in the process context). (so time actually passes from the guest's pov?)

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Juergen Gross
On 21.06.23 22:04, Peter Zijlstra wrote: On Wed, Jun 21, 2023 at 07:19:21PM +, Per Bilse wrote: On 6/21/2023 5:40 PM, Peter Zijlstra wrote: I don't understand it -- fundamentally, how can linux schedule when the guest isn't even running? Hypercall transfers control to the host/hypervisor an

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2023, at 12:05 PM, Per Bilse wrote: > On 6/21/2023 5:27 PM, Andy Lutomirski wrote: >> This code is a horrible mess, with and without your patches. I think that, >> if this were new, there's no way it would make it in to the kernel. > > Hi Andy, and many thanks for your frank as

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Peter Zijlstra
On Wed, Jun 21, 2023 at 07:19:21PM +, Per Bilse wrote: > On 6/21/2023 5:40 PM, Peter Zijlstra wrote: > > I don't understand it -- fundamentally, how can linux schedule when the > > guest isn't even running? Hypercall transfers control to the > > host/hypervisor and leaves the guest suspended. >

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Per Bilse
On 6/21/2023 5:40 PM, Peter Zijlstra wrote: > I don't understand it -- fundamentally, how can linux schedule when the > guest isn't even running? Hypercall transfers control to the > host/hypervisor and leaves the guest suspended. Hi Peter, as noted in earlier note to Andy, this is essentially exi

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Per Bilse
On 6/21/2023 5:27 PM, Andy Lutomirski wrote: > This code is a horrible mess, with and without your patches. I think that, > if this were new, there's no way it would make it in to the kernel. Hi Andy, and many thanks for your frank assessments. Generally, this is indeed somewhat old code, first

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Peter Zijlstra
On Wed, Jun 21, 2023 at 03:14:42PM +, Per Bilse wrote: > Some Xen hypercalls issued by dom0 guests may run for many 10s of > seconds, potentially causing watchdog timeouts and other problems. > It's rare for this to happen, but it does in extreme circumstances, > for instance when shutting down

Re: [PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2023, at 8:14 AM, Per Bilse wrote: > Some Xen hypercalls issued by dom0 guests may run for many 10s of > seconds, potentially causing watchdog timeouts and other problems. > It's rare for this to happen, but it does in extreme circumstances, > for instance when shutting down VMs wit

[PATCH] Updates to Xen hypercall preemption

2023-06-21 Thread Per Bilse
Some Xen hypercalls issued by dom0 guests may run for many 10s of seconds, potentially causing watchdog timeouts and other problems. It's rare for this to happen, but it does in extreme circumstances, for instance when shutting down VMs with very large memory allocations (> 0.5 - 1TB). These hyper