Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-11-04 Thread Yi Sun
On 18-11-01 08:59:08, Waiman Long wrote: > On 10/31/2018 11:20 PM, Yi Sun wrote: > > On 18-10-31 18:15:39, Peter Zijlstra wrote: > >> On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: > >>> On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-11-01 Thread Waiman Long
On 10/31/2018 11:20 PM, Yi Sun wrote: > On 18-10-31 18:15:39, Peter Zijlstra wrote: >> On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: >>> On 10/31/2018 10:10 AM, Peter Zijlstra wrote: On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi Sun wrote: > On 18-10-23 17:33:28, Yi Sun wrote

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-11-01 Thread Peter Zijlstra
On Thu, Nov 01, 2018 at 11:20:21AM +0800, Yi Sun wrote: > On 18-10-31 18:15:39, Peter Zijlstra wrote: > > So Yi, are you actually seeing a problem? If so, can you give details? > > Where does the patch come from? I cannot find it through google. What patch!? The one I posted: https://lkml.ke

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-31 Thread Yi Sun
On 18-10-31 18:15:39, Peter Zijlstra wrote: > On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: > > On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > > > On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi Sun wrote: > > >> On 18-10-23 17:33:28, Yi Sun wrote: > > >>> On 18-10-23 10:51:27, Peter Z

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-31 Thread Peter Zijlstra
On Wed, Oct 31, 2018 at 11:07:22AM -0400, Waiman Long wrote: > On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > > On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi Sun wrote: > >> On 18-10-23 17:33:28, Yi Sun wrote: > >>> On 18-10-23 10:51:27, Peter Zijlstra wrote: > Can you try and explain why vcpu

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-31 Thread Waiman Long
On 10/31/2018 10:10 AM, Peter Zijlstra wrote: > On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi Sun wrote: >> On 18-10-23 17:33:28, Yi Sun wrote: >>> On 18-10-23 10:51:27, Peter Zijlstra wrote: Can you try and explain why vcpu_is_preempted() doesn't work for you? >>> I thought HvSpinWaitInfo is u

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-31 Thread Peter Zijlstra
On Wed, Oct 31, 2018 at 09:54:17AM +0800, Yi Sun wrote: > On 18-10-23 17:33:28, Yi Sun wrote: > > On 18-10-23 10:51:27, Peter Zijlstra wrote: > > > Can you try and explain why vcpu_is_preempted() doesn't work for you? > > > > I thought HvSpinWaitInfo is used to notify hypervisor the spin number >

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-30 Thread Yi Sun
After syncing with Hyper-V team, we have got answers as below. On 18-10-24 16:53:00, Michael Kelley wrote: > From: Yi Sun Sent: Friday, October 19, 2018 6:14 > AM > > > > The HvNotifyLongSpinWait hypercall (HVCALL_NOTIFY_LONG_SPIN_WAIT) > > is used by a guest OS to notify the hypervisor that t

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-30 Thread Yi Sun
On 18-10-23 17:33:28, Yi Sun wrote: > On 18-10-23 10:51:27, Peter Zijlstra wrote: > > On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > > > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > > > > > +#if defined(CONFIG_X86_64) && > > > > > defined(CONFIG_PARAVIRT_SPINLOCKS) && IS

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-24 Thread Yi Sun
Hi, Michael, Thanks a lot for the review and comments! Let us sync with Hyper-V team to confirm these suspicious points. BRs, Sun Yi On 18-10-24 16:53:00, Michael Kelley wrote: > From: Yi Sun Sent: Friday, October 19, 2018 6:14 > AM > > > > The HvNotifyLongSpinWait hypercall (HVCALL_NOTIFY_L

RE: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-24 Thread Michael Kelley
From: Yi Sun Sent: Friday, October 19, 2018 6:14 AM > > The HvNotifyLongSpinWait hypercall (HVCALL_NOTIFY_LONG_SPIN_WAIT) > is used by a guest OS to notify the hypervisor that the calling > virtual processor is attempting to acquire a resource that is > potentially held by another virtual proces

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-23 Thread Yi Sun
On 18-10-23 10:51:27, Peter Zijlstra wrote: > On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > > > +#if defined(CONFIG_X86_64) && defined(CONFIG_PARAVIRT_SPINLOCKS) > > > > && IS_ENABLED(CONFIG_HYPERV) > > > > +

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-23 Thread Peter Zijlstra
On Tue, Oct 23, 2018 at 10:57:40AM +0800, Yi Sun wrote: > On 18-10-22 19:15:16, Peter Zijlstra wrote: > > > +#if defined(CONFIG_X86_64) && defined(CONFIG_PARAVIRT_SPINLOCKS) && > > > IS_ENABLED(CONFIG_HYPERV) > > > +if (!hv_notify_long_spin_wait(SPIN_THRESHOLD -

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Yi Sun
On 18-10-22 19:15:16, Peter Zijlstra wrote: > > Firstly, who come a patch that is grubbing around in kernel/locking/ has > an x86/hyperv subject and isn't Cc'ed to the locking maintainers? > I am sorry. That is my fault to forget to add locking maintainers. > On Mon, Oct 22, 2018 at 12:31:45PM -

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Waiman Long
On 10/22/2018 01:31 PM, Peter Zijlstra wrote: > On Mon, Oct 22, 2018 at 01:27:27PM -0400, Waiman Long wrote: > I agree with Juergen on that. I would suggest rename the vcpu_is_preempted hook into a more generic vcpu_stop_spinning, perhaps, so different hypervisors can act on the info

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Peter Zijlstra
On Mon, Oct 22, 2018 at 01:27:27PM -0400, Waiman Long wrote: > >> I agree with Juergen on that. I would suggest rename the > >> vcpu_is_preempted hook into a more generic vcpu_stop_spinning, perhaps, > >> so different hypervisors can act on the information accordingly. Adding > >> an extra paramet

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Waiman Long
On 10/22/2018 01:15 PM, Peter Zijlstra wrote: > Firstly, who come a patch that is grubbing around in kernel/locking/ has > an x86/hyperv subject and isn't Cc'ed to the locking maintainers? > > On Mon, Oct 22, 2018 at 12:31:45PM -0400, Waiman Long wrote: >> On 10/22/2018 03:32 AM, Juergen Gross wrot

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Peter Zijlstra
Firstly, who come a patch that is grubbing around in kernel/locking/ has an x86/hyperv subject and isn't Cc'ed to the locking maintainers? On Mon, Oct 22, 2018 at 12:31:45PM -0400, Waiman Long wrote: > On 10/22/2018 03:32 AM, Juergen Gross wrote: > > On 22/10/2018 03:53, Yi Sun wrote: > >> On 18

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Waiman Long
On 10/22/2018 03:32 AM, Juergen Gross wrote: > On 22/10/2018 03:53, Yi Sun wrote: >> On 18-10-19 16:20:52, Juergen Gross wrote: >>> On 19/10/2018 15:13, Yi Sun wrote: >> [...] >> diff --git a/kernel/locking/qspinlock_paravirt.h b/kernel/locking/qspinlock_paravirt.h index 0130e48..9e

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-22 Thread Juergen Gross
On 22/10/2018 03:53, Yi Sun wrote: > On 18-10-19 16:20:52, Juergen Gross wrote: >> On 19/10/2018 15:13, Yi Sun wrote: > > [...] > >>> diff --git a/kernel/locking/qspinlock_paravirt.h >>> b/kernel/locking/qspinlock_paravirt.h >>> index 0130e48..9e88c7e 100644 >>> --- a/kernel/locking/qspinlock_pa

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-21 Thread Yi Sun
On 18-10-19 16:20:52, Juergen Gross wrote: > On 19/10/2018 15:13, Yi Sun wrote: [...] > > diff --git a/kernel/locking/qspinlock_paravirt.h > > b/kernel/locking/qspinlock_paravirt.h > > index 0130e48..9e88c7e 100644 > > --- a/kernel/locking/qspinlock_paravirt.h > > +++ b/kernel/locking/qspinlock_

Re: [PATCH v1 2/2] x86/hyperv: make HvNotifyLongSpinWait hypercall

2018-10-19 Thread Juergen Gross
On 19/10/2018 15:13, Yi Sun wrote: > The HvNotifyLongSpinWait hypercall (HVCALL_NOTIFY_LONG_SPIN_WAIT) > is used by a guest OS to notify the hypervisor that the calling > virtual processor is attempting to acquire a resource that is > potentially held by another virtual processor within the same >