Linux virtualization list
 help / color / mirror / Atom feed
* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Peter Zijlstra @ 2016-09-29 10:31 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Pan Xinhui, will.deacon,
	linux-kernel, Heiko Carstens, virtualization, mingo, paulus, mpe,
	xen-devel-request, pbonzini, paulmck, linuxppc-dev
In-Reply-To: <166f3bad-f700-4624-6c1c-996f90ad609c@de.ibm.com>

On Thu, Sep 29, 2016 at 12:23:19PM +0200, Christian Borntraeger wrote:
> On 09/29/2016 12:10 PM, Peter Zijlstra wrote:
> > On Thu, Jul 21, 2016 at 07:45:10AM -0400, Pan Xinhui wrote:
> >> change from v2:
> >> 	no code change, fix typos, update some comments
> >>
> >> change from v1:
> >> 	a simplier definition of default vcpu_is_preempted
> >> 	skip mahcine type check on ppc, and add config. remove dedicated macro.
> >> 	add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner. 
> >> 	add more comments
> >> 	thanks boqun and Peter's suggestion.
> >>
> >> This patch set aims to fix lock holder preemption issues.
> > 
> > So I really like the concept, but I would also really like to see
> > support for more hypervisors included before we can move forward with
> > this.
> > 
> > Please consider s390 and (x86/arm) KVM. Once we have a few, more can
> > follow later, but I think its important to not only have PPC support for
> > this.
> 
> Actually the s390 preemted check via sigp sense running  is available for
> all hypervisors (z/VM, LPAR and KVM) which implies everywhere as you can no
> longer buy s390 systems without LPAR.
> 
> As Heiko already pointed out we could simply use a small inline function
> that calls cpu_is_preempted from arch/s390/lib/spinlock (or smp_vcpu_scheduled from smp.c)

Sure, and I had vague memories of Heiko's email. This patch set however
completely fails to do that trivial hooking up.

^ permalink raw reply

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Christian Borntraeger @ 2016-09-29 10:40 UTC (permalink / raw)
  To: Peter Zijlstra, Pan Xinhui
  Cc: kernellwp, linux-s390, jgross, kvm, xen-devel-request,
	will.deacon, linux-kernel, Heiko Carstens, virtualization, mingo,
	paulus, mpe, benh, pbonzini, paulmck, linuxppc-dev
In-Reply-To: <166f3bad-f700-4624-6c1c-996f90ad609c@de.ibm.com>

On 09/29/2016 12:23 PM, Christian Borntraeger wrote:
> On 09/29/2016 12:10 PM, Peter Zijlstra wrote:
>> On Thu, Jul 21, 2016 at 07:45:10AM -0400, Pan Xinhui wrote:
>>> change from v2:
>>> 	no code change, fix typos, update some comments
>>>
>>> change from v1:
>>> 	a simplier definition of default vcpu_is_preempted
>>> 	skip mahcine type check on ppc, and add config. remove dedicated macro.
>>> 	add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner. 
>>> 	add more comments
>>> 	thanks boqun and Peter's suggestion.
>>>
>>> This patch set aims to fix lock holder preemption issues.
>>
>> So I really like the concept, but I would also really like to see
>> support for more hypervisors included before we can move forward with
>> this.
>>
>> Please consider s390 and (x86/arm) KVM. Once we have a few, more can
>> follow later, but I think its important to not only have PPC support for
>> this.
> 
> Actually the s390 preemted check via sigp sense running  is available for
> all hypervisors (z/VM, LPAR and KVM) which implies everywhere as you can no
> longer buy s390 systems without LPAR.
> 
> As Heiko already pointed out we could simply use a small inline function
> that calls cpu_is_preempted from arch/s390/lib/spinlock (or smp_vcpu_scheduled from smp.c)

Maybe something like
(untested and just pasted, so white space damaged)

diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 63ebf37..6e82986 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -21,6 +21,13 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
        return __sync_bool_compare_and_swap(lock, old, new);
 }
 
+int arch_vcpu_is_preempted(int cpu);
+#define vcpu_is_preempted cpu_is_preempted
+static inline bool cpu_is_preempted(int cpu)
+{
+       return arch_vcpu_is_preempted(cpu);
+}
+
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
  * on the local processor, one does not.
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index e5f50a7..260d179 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -37,7 +37,7 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
        asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
 }
 
-static inline int cpu_is_preempted(int cpu)
+int arch_vcpu_is_preempted(int cpu)
 {
        if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
                return 0;
@@ -45,6 +45,7 @@ static inline int cpu_is_preempted(int cpu)
                return 0;
        return 1;
 }
+EXPORT_SYMBOL(arch_vcpu_is_preempted);
 
 void arch_spin_lock_wait(arch_spinlock_t *lp)
 {



If ok I can respin into a proper patch.

^ permalink raw reply related

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Christian Borntraeger @ 2016-09-29 11:05 UTC (permalink / raw)
  To: Peter Zijlstra, Pan Xinhui
  Cc: kernellwp, linux-s390, jgross, kvm, xen-devel-request,
	will.deacon, linux-kernel, Heiko Carstens, virtualization, mingo,
	paulus, mpe, benh, pbonzini, paulmck, linuxppc-dev
In-Reply-To: <f521d8cb-c38b-a608-eca8-a5c45184bbca@de.ibm.com>

On 09/29/2016 12:40 PM, Christian Borntraeger wrote:
> On 09/29/2016 12:23 PM, Christian Borntraeger wrote:
>> On 09/29/2016 12:10 PM, Peter Zijlstra wrote:
>>> On Thu, Jul 21, 2016 at 07:45:10AM -0400, Pan Xinhui wrote:
>>>> change from v2:
>>>> 	no code change, fix typos, update some comments
>>>>
>>>> change from v1:
>>>> 	a simplier definition of default vcpu_is_preempted
>>>> 	skip mahcine type check on ppc, and add config. remove dedicated macro.
>>>> 	add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner. 
>>>> 	add more comments
>>>> 	thanks boqun and Peter's suggestion.
>>>>
>>>> This patch set aims to fix lock holder preemption issues.
>>>
>>> So I really like the concept, but I would also really like to see
>>> support for more hypervisors included before we can move forward with
>>> this.
>>>
>>> Please consider s390 and (x86/arm) KVM. Once we have a few, more can
>>> follow later, but I think its important to not only have PPC support for
>>> this.
>>
>> Actually the s390 preemted check via sigp sense running  is available for
>> all hypervisors (z/VM, LPAR and KVM) which implies everywhere as you can no
>> longer buy s390 systems without LPAR.
>>
>> As Heiko already pointed out we could simply use a small inline function
>> that calls cpu_is_preempted from arch/s390/lib/spinlock (or smp_vcpu_scheduled from smp.c)
> 
> Maybe something like
> (untested and just pasted, so white space damaged)

Now tested. With 8 host cpus and 16 guest cpus perf bench sched shows the
same improvements as in Pan Xinhuis cover letter.
Also the runtime shrinks a lot.

> 
> diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
> index 63ebf37..6e82986 100644
> --- a/arch/s390/include/asm/spinlock.h
> +++ b/arch/s390/include/asm/spinlock.h
> @@ -21,6 +21,13 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
>         return __sync_bool_compare_and_swap(lock, old, new);
>  }
> 
> +int arch_vcpu_is_preempted(int cpu);
> +#define vcpu_is_preempted cpu_is_preempted
> +static inline bool cpu_is_preempted(int cpu)
> +{
> +       return arch_vcpu_is_preempted(cpu);
> +}
> +
>  /*
>   * Simple spin lock operations.  There are two variants, one clears IRQ's
>   * on the local processor, one does not.
> diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
> index e5f50a7..260d179 100644
> --- a/arch/s390/lib/spinlock.c
> +++ b/arch/s390/lib/spinlock.c
> @@ -37,7 +37,7 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
>         asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
>  }
> 
> -static inline int cpu_is_preempted(int cpu)
> +int arch_vcpu_is_preempted(int cpu)
>  {
>         if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
>                 return 0;
> @@ -45,6 +45,7 @@ static inline int cpu_is_preempted(int cpu)
>                 return 0;
>         return 1;
>  }
> +EXPORT_SYMBOL(arch_vcpu_is_preempted);
> 
>  void arch_spin_lock_wait(arch_spinlock_t *lp)
>  {
> 
> 
> 
> If ok I can respin into a proper patch.

^ permalink raw reply

* [PATCH] s390x/spinlock: Provide vcpu_is_preempted globally
From: Christian Borntraeger @ 2016-09-29 11:54 UTC (permalink / raw)
  To: Peter Zijlstra, Martin Schwidefsky, Heiko Carstens
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Pan Xinhui, will.deacon,
	linux-kernel, virtualization, mingo, paulus, mpe,
	xen-devel-request, pbonzini, paulmck

this implements the s390 backend for commit
"kernel/sched: introduce vcpu preempted check interface"
by simply reusing the existing cpu_is_preempted function.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
Martin, Heiko,

this patch is a minimal change by not touching all existing users of
cpu_is_preempted in spinlock.c. If you want it differently, let me
know.


 arch/s390/include/asm/spinlock.h | 7 +++++++
 arch/s390/lib/spinlock.c         | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 63ebf37..6e82986 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -21,6 +21,13 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
 	return __sync_bool_compare_and_swap(lock, old, new);
 }
 
+int arch_vcpu_is_preempted(int cpu);
+#define vcpu_is_preempted cpu_is_preempted
+static inline bool cpu_is_preempted(int cpu)
+{
+	return arch_vcpu_is_preempted(cpu);
+}
+
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
  * on the local processor, one does not.
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index e5f50a7..9f473c8 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -37,7 +37,7 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
 	asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
 }
 
-static inline int cpu_is_preempted(int cpu)
+int arch_vcpu_is_preempted(int cpu)
 {
 	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
 		return 0;
@@ -45,6 +45,7 @@ static inline int cpu_is_preempted(int cpu)
 		return 0;
 	return 1;
 }
+EXPORT_SYMBOL(arch_vcpu_is_preempted);
 
 void arch_spin_lock_wait(arch_spinlock_t *lp)
 {
-- 
2.5.5

^ permalink raw reply related

* Re: [PATCH] s390x/spinlock: Provide vcpu_is_preempted globally
From: Martin Schwidefsky @ 2016-09-29 13:11 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, Heiko Carstens, linux-kernel, will.deacon,
	virtualization, mingo, paulus, mpe, xen-devel-request, pbonzini,
	paulmck
In-Reply-To: <1475150056-58774-1-git-send-email-borntraeger@de.ibm.com>

On Thu, 29 Sep 2016 13:54:16 +0200
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> this implements the s390 backend for commit
> "kernel/sched: introduce vcpu preempted check interface"
> by simply reusing the existing cpu_is_preempted function.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
> Martin, Heiko,
> 
> this patch is a minimal change by not touching all existing users of
> cpu_is_preempted in spinlock.c. If you want it differently, let me
> know.
> 
> 
>  arch/s390/include/asm/spinlock.h | 7 +++++++
>  arch/s390/lib/spinlock.c         | 3 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
> index 63ebf37..6e82986 100644
> --- a/arch/s390/include/asm/spinlock.h
> +++ b/arch/s390/include/asm/spinlock.h
> @@ -21,6 +21,13 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
>  	return __sync_bool_compare_and_swap(lock, old, new);
>  }
> 
> +int arch_vcpu_is_preempted(int cpu);
> +#define vcpu_is_preempted cpu_is_preempted
> +static inline bool cpu_is_preempted(int cpu)
> +{
> +	return arch_vcpu_is_preempted(cpu);
> +}
> +
>  /*
>   * Simple spin lock operations.  There are two variants, one clears IRQ's
>   * on the local processor, one does not.
> diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
> index e5f50a7..9f473c8 100644
> --- a/arch/s390/lib/spinlock.c
> +++ b/arch/s390/lib/spinlock.c
> @@ -37,7 +37,7 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
>  	asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
>  }
> 
> -static inline int cpu_is_preempted(int cpu)
> +int arch_vcpu_is_preempted(int cpu)
>  {
>  	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
>  		return 0;
> @@ -45,6 +45,7 @@ static inline int cpu_is_preempted(int cpu)
>  		return 0;
>  	return 1;
>  }
> +EXPORT_SYMBOL(arch_vcpu_is_preempted);
> 
>  void arch_spin_lock_wait(arch_spinlock_t *lp)
>  {

Hmm, if I look at the code we now have an additional function for
the spinlock loops. The call arch_vcpu_is_preempted which test
CIF_ENABLED_WAIT and then calls smp_vcpu_scheduled(). The test
used to be inline.

A better solution would be to move the CIF_ENABLED_WAIT test to the
smp_vcpu_scheduled() function, rename it to arch_vcpu_is_preempted()
and then export that function. The cpu_is_preempted() function is
replaced by arch_vcpu_is_preempted() which does make a lot of sense,
no?

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

^ permalink raw reply

* Re: [PATCH] s390x/spinlock: Provide vcpu_is_preempted globally
From: Christian Borntraeger @ 2016-09-29 13:21 UTC (permalink / raw)
  To: Martin Schwidefsky
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, Heiko Carstens, linux-kernel, will.deacon,
	virtualization, mingo, paulus, mpe, xen-devel-request, pbonzini,
	paulmck
In-Reply-To: <20160929151116.3b5e8f07@mschwide>

On 09/29/2016 03:11 PM, Martin Schwidefsky wrote:
> On Thu, 29 Sep 2016 13:54:16 +0200
> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> 
>> this implements the s390 backend for commit
>> "kernel/sched: introduce vcpu preempted check interface"
>> by simply reusing the existing cpu_is_preempted function.
>>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>> Martin, Heiko,
>>
>> this patch is a minimal change by not touching all existing users of
>> cpu_is_preempted in spinlock.c. If you want it differently, let me
>> know.
>>
>>
>>  arch/s390/include/asm/spinlock.h | 7 +++++++
>>  arch/s390/lib/spinlock.c         | 3 ++-
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
>> index 63ebf37..6e82986 100644
>> --- a/arch/s390/include/asm/spinlock.h
>> +++ b/arch/s390/include/asm/spinlock.h
>> @@ -21,6 +21,13 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
>>  	return __sync_bool_compare_and_swap(lock, old, new);
>>  }
>>
>> +int arch_vcpu_is_preempted(int cpu);
>> +#define vcpu_is_preempted cpu_is_preempted
>> +static inline bool cpu_is_preempted(int cpu)
>> +{
>> +	return arch_vcpu_is_preempted(cpu);
>> +}
>> +
>>  /*
>>   * Simple spin lock operations.  There are two variants, one clears IRQ's
>>   * on the local processor, one does not.
>> diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
>> index e5f50a7..9f473c8 100644
>> --- a/arch/s390/lib/spinlock.c
>> +++ b/arch/s390/lib/spinlock.c
>> @@ -37,7 +37,7 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
>>  	asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
>>  }
>>
>> -static inline int cpu_is_preempted(int cpu)
>> +int arch_vcpu_is_preempted(int cpu)
>>  {
>>  	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
>>  		return 0;
>> @@ -45,6 +45,7 @@ static inline int cpu_is_preempted(int cpu)
>>  		return 0;
>>  	return 1;
>>  }
>> +EXPORT_SYMBOL(arch_vcpu_is_preempted);
>>
>>  void arch_spin_lock_wait(arch_spinlock_t *lp)
>>  {
> 
> Hmm, if I look at the code we now have an additional function for
> the spinlock loops. The call arch_vcpu_is_preempted which test
> CIF_ENABLED_WAIT and then calls smp_vcpu_scheduled(). The test
> used to be inline.
> 
> A better solution would be to move the CIF_ENABLED_WAIT test to the
> smp_vcpu_scheduled() function, rename it to arch_vcpu_is_preempted()
> and then export that function.
 The cpu_is_preempted() function is
> replaced by arch_vcpu_is_preempted() which does make a lot of sense,
> no?
> 

Yes that makes sense, will spin a v2.

^ permalink raw reply

* [PATCH v2 0/1] s390 preparation for vcpu preempted check
From: Christian Borntraeger @ 2016-09-29 15:51 UTC (permalink / raw)
  To: Peter Zijlstra, Martin Schwidefsky, Heiko Carstens
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Pan Xinhui, will.deacon,
	linux-kernel, virtualization, mingo, paulus, mpe,
	xen-devel-request, pbonzini, paulmck

This patch should enable s390 support for the upcoming vcpu
preempt check support, but it should compile and work fine 
without that patch set as well.

Christian Borntraeger (1):
  s390/spinlock: Provide vcpu_is_preempted

 arch/s390/include/asm/spinlock.h |  3 +++
 arch/s390/kernel/smp.c           |  9 +++++++--
 arch/s390/lib/spinlock.c         | 25 ++++++++-----------------
 3 files changed, 18 insertions(+), 19 deletions(-)

-- 
2.5.5

^ permalink raw reply

* [PATCH v2 1/1] s390/spinlock: Provide vcpu_is_preempted
From: Christian Borntraeger @ 2016-09-29 15:51 UTC (permalink / raw)
  To: Peter Zijlstra, Martin Schwidefsky, Heiko Carstens
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Pan Xinhui, will.deacon,
	linux-kernel, virtualization, mingo, paulus, mpe,
	xen-devel-request, pbonzini, paulmck
In-Reply-To: <1475164265-246160-1-git-send-email-borntraeger@de.ibm.com>

this implements the s390 backend for commit
"kernel/sched: introduce vcpu preempted check interface"
by reworking the existing smp_vcpu_scheduled into
arch_vcpu_is_preempted. We can then also get rid of the
local cpu_is_preempted function by moving the
CIF_ENABLED_WAIT test into arch_vcpu_is_preempted.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/include/asm/spinlock.h |  3 +++
 arch/s390/kernel/smp.c           |  9 +++++++--
 arch/s390/lib/spinlock.c         | 25 ++++++++-----------------
 3 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 63ebf37..e16e02f 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -21,6 +21,9 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
 	return __sync_bool_compare_and_swap(lock, old, new);
 }
 
+bool arch_vcpu_is_preempted(int cpu);
+#define vcpu_is_preempted arch_vcpu_is_preempted
+
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
  * on the local processor, one does not.
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 7b89a75..4aadd16 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -376,10 +376,15 @@ int smp_find_processor_id(u16 address)
 	return -1;
 }
 
-int smp_vcpu_scheduled(int cpu)
+bool arch_vcpu_is_preempted(int cpu)
 {
-	return pcpu_running(pcpu_devices + cpu);
+	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
+		return false;
+	if (pcpu_running(pcpu_devices + cpu))
+		return false;
+	return true;
 }
+EXPORT_SYMBOL(arch_vcpu_is_preempted);
 
 void smp_yield_cpu(int cpu)
 {
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index e5f50a7..e48a48e 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -37,15 +37,6 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
 	asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
 }
 
-static inline int cpu_is_preempted(int cpu)
-{
-	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
-		return 0;
-	if (smp_vcpu_scheduled(cpu))
-		return 0;
-	return 1;
-}
-
 void arch_spin_lock_wait(arch_spinlock_t *lp)
 {
 	unsigned int cpu = SPINLOCK_LOCKVAL;
@@ -62,7 +53,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
 			continue;
 		}
 		/* First iteration: check if the lock owner is running. */
-		if (first_diag && cpu_is_preempted(~owner)) {
+		if (first_diag && arch_vcpu_is_preempted(~owner)) {
 			smp_yield_cpu(~owner);
 			first_diag = 0;
 			continue;
@@ -81,7 +72,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
 		 * yield the CPU unconditionally. For LPAR rely on the
 		 * sense running status.
 		 */
-		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
+		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
 			smp_yield_cpu(~owner);
 			first_diag = 0;
 		}
@@ -108,7 +99,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
 			continue;
 		}
 		/* Check if the lock owner is running. */
-		if (first_diag && cpu_is_preempted(~owner)) {
+		if (first_diag && arch_vcpu_is_preempted(~owner)) {
 			smp_yield_cpu(~owner);
 			first_diag = 0;
 			continue;
@@ -127,7 +118,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
 		 * yield the CPU unconditionally. For LPAR rely on the
 		 * sense running status.
 		 */
-		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
+		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
 			smp_yield_cpu(~owner);
 			first_diag = 0;
 		}
@@ -165,7 +156,7 @@ void _raw_read_lock_wait(arch_rwlock_t *rw)
 	owner = 0;
 	while (1) {
 		if (count-- <= 0) {
-			if (owner && cpu_is_preempted(~owner))
+			if (owner && arch_vcpu_is_preempted(~owner))
 				smp_yield_cpu(~owner);
 			count = spin_retry;
 		}
@@ -211,7 +202,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw, unsigned int prev)
 	owner = 0;
 	while (1) {
 		if (count-- <= 0) {
-			if (owner && cpu_is_preempted(~owner))
+			if (owner && arch_vcpu_is_preempted(~owner))
 				smp_yield_cpu(~owner);
 			count = spin_retry;
 		}
@@ -241,7 +232,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw)
 	owner = 0;
 	while (1) {
 		if (count-- <= 0) {
-			if (owner && cpu_is_preempted(~owner))
+			if (owner && arch_vcpu_is_preempted(~owner))
 				smp_yield_cpu(~owner);
 			count = spin_retry;
 		}
@@ -285,7 +276,7 @@ void arch_lock_relax(unsigned int cpu)
 {
 	if (!cpu)
 		return;
-	if (MACHINE_IS_LPAR && !cpu_is_preempted(~cpu))
+	if (MACHINE_IS_LPAR && !arch_vcpu_is_preempted(~cpu))
 		return;
 	smp_yield_cpu(~cpu);
 }
-- 
2.5.5

^ permalink raw reply related

* [PATCH] x86/vmware: Skip lapic calibration on VMware.
From: Renat Valiullin @ 2016-09-29 17:51 UTC (permalink / raw)
  To: Alok Kataria, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86@kernel.org, virtualization@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org

In virtualized environment the APIC timer calibration could go wrong
when the host is overcommitted or the guest is running nested,
this would result in the APIC timers operating at an incorrect frequency.
Since VMware supports a mechanism to retrieve the local APIC frequency
we can ask the hypervisor for it and skip this APIC calibration loop.

Signed-off-by: Renat Valiullin <rvaliullin@vmware.com>
Acked-by: Alok N Kataria <akataria@vmware.com>
---
 arch/x86/kernel/cpu/vmware.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index 1ff0598..6316240 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -27,6 +27,7 @@
 #include <asm/div64.h>
 #include <asm/x86_init.h>
 #include <asm/hypervisor.h>
+#include <asm/apic.h>

 #define CPUID_VMWARE_INFO_LEAF 0x40000000
 #define VMWARE_HYPERVISOR_MAGIC        0x564D5868
@@ -82,9 +83,15 @@ static void __init vmware_platform_setup(void)

        VMWARE_PORT(GETHZ, eax, ebx, ecx, edx);

-       if (ebx != UINT_MAX)
+       if (ebx != UINT_MAX) {
                x86_platform.calibrate_tsc = vmware_get_tsc_khz;
-       else
+#ifdef CONFIG_X86_LOCAL_APIC
+               /* Skip lapic calibration since we know the bus frequency. */
+               lapic_timer_frequency = ecx / HZ;
+               pr_info("Host bus clock speed read from hypervisor : %u Hz\n",
+                       ecx);
+#endif
+       } else
                pr_warn("Failed to get TSC freq from the hypervisor\n");
 }

-- 
2.7.4


_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply related

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Pan Xinhui @ 2016-09-30  4:00 UTC (permalink / raw)
  To: Peter Zijlstra, Pan Xinhui
  Cc: kernellwp, linux-s390, jgross, kvm, xen-devel-request,
	will.deacon, linux-kernel, virtualization, mingo, paulus, mpe,
	benh, pbonzini, paulmck, linuxppc-dev
In-Reply-To: <20160929101040.GV5016@twins.programming.kicks-ass.net>



在 2016/9/29 18:10, Peter Zijlstra 写道:
> On Thu, Jul 21, 2016 at 07:45:10AM -0400, Pan Xinhui wrote:
>> change from v2:
>> 	no code change, fix typos, update some comments
>>
>> change from v1:
>> 	a simplier definition of default vcpu_is_preempted
>> 	skip mahcine type check on ppc, and add config. remove dedicated macro.
>> 	add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
>> 	add more comments
>> 	thanks boqun and Peter's suggestion.
>>
>> This patch set aims to fix lock holder preemption issues.
>
> So I really like the concept, but I would also really like to see
> support for more hypervisors included before we can move forward with
> this.
>
> Please consider s390 and (x86/arm) KVM. Once we have a few, more can
> follow later, but I think its important to not only have PPC support for
> this.
>
hi, Peter
	right, we need consider more arches.
I will try to work out a RFC patch on x86 anyway. There are already some discussions of the solution on x86 :)

thanks
xinhui

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v2 1/1] s390/spinlock: Provide vcpu_is_preempted
From: Pan Xinhui @ 2016-09-30  4:49 UTC (permalink / raw)
  To: Christian Borntraeger, Peter Zijlstra, Martin Schwidefsky,
	Heiko Carstens
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Pan Xinhui, will.deacon,
	linux-kernel, virtualization, mingo, paulus, mpe,
	xen-devel-request, pbonzini, paulmck
In-Reply-To: <1475164265-246160-2-git-send-email-borntraeger@de.ibm.com>



在 2016/9/29 23:51, Christian Borntraeger 写道:
> this implements the s390 backend for commit
> "kernel/sched: introduce vcpu preempted check interface"
> by reworking the existing smp_vcpu_scheduled into
> arch_vcpu_is_preempted. We can then also get rid of the
> local cpu_is_preempted function by moving the
> CIF_ENABLED_WAIT test into arch_vcpu_is_preempted.
>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---

hi, Christian
	thanks for your patch!

>  arch/s390/include/asm/spinlock.h |  3 +++
>  arch/s390/kernel/smp.c           |  9 +++++++--
>  arch/s390/lib/spinlock.c         | 25 ++++++++-----------------
>  3 files changed, 18 insertions(+), 19 deletions(-)
>
> diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
> index 63ebf37..e16e02f 100644
> --- a/arch/s390/include/asm/spinlock.h
> +++ b/arch/s390/include/asm/spinlock.h
> @@ -21,6 +21,9 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
>  	return __sync_bool_compare_and_swap(lock, old, new);
>  }
>
> +bool arch_vcpu_is_preempted(int cpu);
> +#define vcpu_is_preempted arch_vcpu_is_preempted
> +
>  /*
>   * Simple spin lock operations.  There are two variants, one clears IRQ's
>   * on the local processor, one does not.
> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
> index 7b89a75..4aadd16 100644
> --- a/arch/s390/kernel/smp.c
> +++ b/arch/s390/kernel/smp.c
> @@ -376,10 +376,15 @@ int smp_find_processor_id(u16 address)
>  	return -1;
>  }
>
> -int smp_vcpu_scheduled(int cpu)
  
root@ltcalpine2-lp13:~/linux# git grep -wn smp_vcpu_scheduled arch/s390/
arch/s390/include/asm/smp.h:34:extern int smp_vcpu_scheduled(int cpu);
arch/s390/include/asm/smp.h:56:static inline int smp_vcpu_scheduled(int cpu) { return 1; }
arch/s390/kernel/smp.c:371:int smp_vcpu_scheduled(int cpu)
arch/s390/lib/spinlock.c:44:    if (smp_vcpu_scheduled(cpu))

> +bool arch_vcpu_is_preempted(int cpu)
>  {
> -	return pcpu_running(pcpu_devices + cpu);
> +	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
> +		return false;
> +	if (pcpu_running(pcpu_devices + cpu))
> +		return false;
I saw smp_vcpu_scheduled() returns true always on !SMP system.

maybe we can do somegthing silimar. like below

#ifndef CONFIG_SMP
static inline bool arch_vcpu_is_preempted(int cpu) { return !test_cpu_flag_of(CIF_ENABLED_WAIT, cpu); }
#else
...

but I can't help thinking that if this is a!SMP system, maybe we could only
#ifndef CONFIG_SMP
static inline bool arch_vcpu_is_preempted(int cpu) { return false; }
#else
...


thanks
xinhui

> +	return true;
>  }
> +EXPORT_SYMBOL(arch_vcpu_is_preempted);
>
>  void smp_yield_cpu(int cpu)
>  {
> diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
> index e5f50a7..e48a48e 100644
> --- a/arch/s390/lib/spinlock.c
> +++ b/arch/s390/lib/spinlock.c
> @@ -37,15 +37,6 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
>  	asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
>  }
>
> -static inline int cpu_is_preempted(int cpu)
> -{
> -	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
> -		return 0;
> -	if (smp_vcpu_scheduled(cpu))
> -		return 0;
> -	return 1;
> -}
> -
>  void arch_spin_lock_wait(arch_spinlock_t *lp)
>  {
>  	unsigned int cpu = SPINLOCK_LOCKVAL;
> @@ -62,7 +53,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
>  			continue;
>  		}
>  		/* First iteration: check if the lock owner is running. */
> -		if (first_diag && cpu_is_preempted(~owner)) {
> +		if (first_diag && arch_vcpu_is_preempted(~owner)) {
>  			smp_yield_cpu(~owner);
>  			first_diag = 0;
>  			continue;
> @@ -81,7 +72,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
>  		 * yield the CPU unconditionally. For LPAR rely on the
>  		 * sense running status.
>  		 */
> -		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
> +		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
>  			smp_yield_cpu(~owner);
>  			first_diag = 0;
>  		}
> @@ -108,7 +99,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
>  			continue;
>  		}
>  		/* Check if the lock owner is running. */
> -		if (first_diag && cpu_is_preempted(~owner)) {
> +		if (first_diag && arch_vcpu_is_preempted(~owner)) {
>  			smp_yield_cpu(~owner);
>  			first_diag = 0;
>  			continue;
> @@ -127,7 +118,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
>  		 * yield the CPU unconditionally. For LPAR rely on the
>  		 * sense running status.
>  		 */
> -		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
> +		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
>  			smp_yield_cpu(~owner);
>  			first_diag = 0;
>  		}
> @@ -165,7 +156,7 @@ void _raw_read_lock_wait(arch_rwlock_t *rw)
>  	owner = 0;
>  	while (1) {
>  		if (count-- <= 0) {
> -			if (owner && cpu_is_preempted(~owner))
> +			if (owner && arch_vcpu_is_preempted(~owner))
>  				smp_yield_cpu(~owner);
>  			count = spin_retry;
>  		}
> @@ -211,7 +202,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw, unsigned int prev)
>  	owner = 0;
>  	while (1) {
>  		if (count-- <= 0) {
> -			if (owner && cpu_is_preempted(~owner))
> +			if (owner && arch_vcpu_is_preempted(~owner))
>  				smp_yield_cpu(~owner);
>  			count = spin_retry;
>  		}
> @@ -241,7 +232,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw)
>  	owner = 0;
>  	while (1) {
>  		if (count-- <= 0) {
> -			if (owner && cpu_is_preempted(~owner))
> +			if (owner && arch_vcpu_is_preempted(~owner))
>  				smp_yield_cpu(~owner);
>  			count = spin_retry;
>  		}
> @@ -285,7 +276,7 @@ void arch_lock_relax(unsigned int cpu)
>  {
>  	if (!cpu)
>  		return;
> -	if (MACHINE_IS_LPAR && !cpu_is_preempted(~cpu))
> +	if (MACHINE_IS_LPAR && !arch_vcpu_is_preempted(~cpu))
>  		return;
>  	smp_yield_cpu(~cpu);
>  }
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Pan Xinhui @ 2016-09-30  5:03 UTC (permalink / raw)
  To: Peter Zijlstra, Christian Borntraeger
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Pan Xinhui, will.deacon,
	linux-kernel, Heiko Carstens, virtualization, mingo, paulus, mpe,
	xen-devel-request, pbonzini, paulmck, linuxppc-dev
In-Reply-To: <20160929103133.GW5016@twins.programming.kicks-ass.net>



在 2016/9/29 18:31, Peter Zijlstra 写道:
> On Thu, Sep 29, 2016 at 12:23:19PM +0200, Christian Borntraeger wrote:
>> On 09/29/2016 12:10 PM, Peter Zijlstra wrote:
>>> On Thu, Jul 21, 2016 at 07:45:10AM -0400, Pan Xinhui wrote:
>>>> change from v2:
>>>> 	no code change, fix typos, update some comments
>>>>
>>>> change from v1:
>>>> 	a simplier definition of default vcpu_is_preempted
>>>> 	skip mahcine type check on ppc, and add config. remove dedicated macro.
>>>> 	add one patch to drop overload of rwsem_spin_on_owner and mutex_spin_on_owner.
>>>> 	add more comments
>>>> 	thanks boqun and Peter's suggestion.
>>>>
>>>> This patch set aims to fix lock holder preemption issues.
>>>
>>> So I really like the concept, but I would also really like to see
>>> support for more hypervisors included before we can move forward with
>>> this.
>>>
>>> Please consider s390 and (x86/arm) KVM. Once we have a few, more can
>>> follow later, but I think its important to not only have PPC support for
>>> this.
>>
>> Actually the s390 preemted check via sigp sense running  is available for
>> all hypervisors (z/VM, LPAR and KVM) which implies everywhere as you can no
>> longer buy s390 systems without LPAR.
>>
>> As Heiko already pointed out we could simply use a small inline function
>> that calls cpu_is_preempted from arch/s390/lib/spinlock (or smp_vcpu_scheduled from smp.c)
>
> Sure, and I had vague memories of Heiko's email. This patch set however
> completely fails to do that trivial hooking up.
>

sorry for that.
I will try to work it out on x86.

Hi, Will
	I appreciate that if you or some other arm guys could help on it. :)

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v2 1/1] s390/spinlock: Provide vcpu_is_preempted
From: Boqun Feng @ 2016-09-30  5:52 UTC (permalink / raw)
  To: Pan Xinhui
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, Heiko Carstens, linux-kernel, will.deacon,
	virtualization, mingo, paulus, mpe, xen-devel-request,
	Martin Schwidefsky, pbonzini, paulmck
In-Reply-To: <b2ace794-c1cc-11be-f9f5-d6429e192825@linux.vnet.ibm.com>


[-- Attachment #1.1: Type: text/plain, Size: 6500 bytes --]

On Fri, Sep 30, 2016 at 12:49:52PM +0800, Pan Xinhui wrote:
> 
> 
> 在 2016/9/29 23:51, Christian Borntraeger 写道:
> > this implements the s390 backend for commit
> > "kernel/sched: introduce vcpu preempted check interface"
> > by reworking the existing smp_vcpu_scheduled into
> > arch_vcpu_is_preempted. We can then also get rid of the
> > local cpu_is_preempted function by moving the
> > CIF_ENABLED_WAIT test into arch_vcpu_is_preempted.
> > 
> > Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> > ---
> 
> hi, Christian
> 	thanks for your patch!
> 
> >  arch/s390/include/asm/spinlock.h |  3 +++
> >  arch/s390/kernel/smp.c           |  9 +++++++--
> >  arch/s390/lib/spinlock.c         | 25 ++++++++-----------------
> >  3 files changed, 18 insertions(+), 19 deletions(-)
> > 
> > diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
> > index 63ebf37..e16e02f 100644
> > --- a/arch/s390/include/asm/spinlock.h
> > +++ b/arch/s390/include/asm/spinlock.h
> > @@ -21,6 +21,9 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
> >  	return __sync_bool_compare_and_swap(lock, old, new);
> >  }
> > 
> > +bool arch_vcpu_is_preempted(int cpu);
> > +#define vcpu_is_preempted arch_vcpu_is_preempted
> > +
> >  /*
> >   * Simple spin lock operations.  There are two variants, one clears IRQ's
> >   * on the local processor, one does not.
> > diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
> > index 7b89a75..4aadd16 100644
> > --- a/arch/s390/kernel/smp.c
> > +++ b/arch/s390/kernel/smp.c
> > @@ -376,10 +376,15 @@ int smp_find_processor_id(u16 address)
> >  	return -1;
> >  }
> > 
> > -int smp_vcpu_scheduled(int cpu)
> root@ltcalpine2-lp13:~/linux# git grep -wn smp_vcpu_scheduled arch/s390/
> arch/s390/include/asm/smp.h:34:extern int smp_vcpu_scheduled(int cpu);
> arch/s390/include/asm/smp.h:56:static inline int smp_vcpu_scheduled(int cpu) { return 1; }
> arch/s390/kernel/smp.c:371:int smp_vcpu_scheduled(int cpu)
> arch/s390/lib/spinlock.c:44:    if (smp_vcpu_scheduled(cpu))
> 
> > +bool arch_vcpu_is_preempted(int cpu)
> >  {
> > -	return pcpu_running(pcpu_devices + cpu);
> > +	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
> > +		return false;
> > +	if (pcpu_running(pcpu_devices + cpu))
> > +		return false;
> I saw smp_vcpu_scheduled() returns true always on !SMP system.
> 
> maybe we can do somegthing silimar. like below
> 
> #ifndef CONFIG_SMP
> static inline bool arch_vcpu_is_preempted(int cpu) { return !test_cpu_flag_of(CIF_ENABLED_WAIT, cpu); }
> #else
> ...
> 
> but I can't help thinking that if this is a!SMP system, maybe we could only
> #ifndef CONFIG_SMP
> static inline bool arch_vcpu_is_preempted(int cpu) { return false; }
> #else

Why do we need a vcpu_is_preempted() implementation for UP? Where will
you use it?

Regards,
Boqun

> ...
> 
> 
> thanks
> xinhui
> 
> > +	return true;
> >  }
> > +EXPORT_SYMBOL(arch_vcpu_is_preempted);
> > 
> >  void smp_yield_cpu(int cpu)
> >  {
> > diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
> > index e5f50a7..e48a48e 100644
> > --- a/arch/s390/lib/spinlock.c
> > +++ b/arch/s390/lib/spinlock.c
> > @@ -37,15 +37,6 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
> >  	asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
> >  }
> > 
> > -static inline int cpu_is_preempted(int cpu)
> > -{
> > -	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
> > -		return 0;
> > -	if (smp_vcpu_scheduled(cpu))
> > -		return 0;
> > -	return 1;
> > -}
> > -
> >  void arch_spin_lock_wait(arch_spinlock_t *lp)
> >  {
> >  	unsigned int cpu = SPINLOCK_LOCKVAL;
> > @@ -62,7 +53,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
> >  			continue;
> >  		}
> >  		/* First iteration: check if the lock owner is running. */
> > -		if (first_diag && cpu_is_preempted(~owner)) {
> > +		if (first_diag && arch_vcpu_is_preempted(~owner)) {
> >  			smp_yield_cpu(~owner);
> >  			first_diag = 0;
> >  			continue;
> > @@ -81,7 +72,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
> >  		 * yield the CPU unconditionally. For LPAR rely on the
> >  		 * sense running status.
> >  		 */
> > -		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
> > +		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
> >  			smp_yield_cpu(~owner);
> >  			first_diag = 0;
> >  		}
> > @@ -108,7 +99,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
> >  			continue;
> >  		}
> >  		/* Check if the lock owner is running. */
> > -		if (first_diag && cpu_is_preempted(~owner)) {
> > +		if (first_diag && arch_vcpu_is_preempted(~owner)) {
> >  			smp_yield_cpu(~owner);
> >  			first_diag = 0;
> >  			continue;
> > @@ -127,7 +118,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
> >  		 * yield the CPU unconditionally. For LPAR rely on the
> >  		 * sense running status.
> >  		 */
> > -		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
> > +		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
> >  			smp_yield_cpu(~owner);
> >  			first_diag = 0;
> >  		}
> > @@ -165,7 +156,7 @@ void _raw_read_lock_wait(arch_rwlock_t *rw)
> >  	owner = 0;
> >  	while (1) {
> >  		if (count-- <= 0) {
> > -			if (owner && cpu_is_preempted(~owner))
> > +			if (owner && arch_vcpu_is_preempted(~owner))
> >  				smp_yield_cpu(~owner);
> >  			count = spin_retry;
> >  		}
> > @@ -211,7 +202,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw, unsigned int prev)
> >  	owner = 0;
> >  	while (1) {
> >  		if (count-- <= 0) {
> > -			if (owner && cpu_is_preempted(~owner))
> > +			if (owner && arch_vcpu_is_preempted(~owner))
> >  				smp_yield_cpu(~owner);
> >  			count = spin_retry;
> >  		}
> > @@ -241,7 +232,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw)
> >  	owner = 0;
> >  	while (1) {
> >  		if (count-- <= 0) {
> > -			if (owner && cpu_is_preempted(~owner))
> > +			if (owner && arch_vcpu_is_preempted(~owner))
> >  				smp_yield_cpu(~owner);
> >  			count = spin_retry;
> >  		}
> > @@ -285,7 +276,7 @@ void arch_lock_relax(unsigned int cpu)
> >  {
> >  	if (!cpu)
> >  		return;
> > -	if (MACHINE_IS_LPAR && !cpu_is_preempted(~cpu))
> > +	if (MACHINE_IS_LPAR && !arch_vcpu_is_preempted(~cpu))
> >  		return;
> >  	smp_yield_cpu(~cpu);
> >  }
> > 
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v2 1/1] s390/spinlock: Provide vcpu_is_preempted
From: Pan Xinhui @ 2016-09-30  6:35 UTC (permalink / raw)
  To: Boqun Feng
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, Heiko Carstens, linux-kernel, will.deacon,
	virtualization, mingo, paulus, mpe, xen-devel-request,
	Martin Schwidefsky, pbonzini, paulmck
In-Reply-To: <20160930055236.GB22004@tardis.cn.ibm.com>



在 2016/9/30 13:52, Boqun Feng 写道:
> On Fri, Sep 30, 2016 at 12:49:52PM +0800, Pan Xinhui wrote:
>>
>>
>> 在 2016/9/29 23:51, Christian Borntraeger 写道:
>>> this implements the s390 backend for commit
>>> "kernel/sched: introduce vcpu preempted check interface"
>>> by reworking the existing smp_vcpu_scheduled into
>>> arch_vcpu_is_preempted. We can then also get rid of the
>>> local cpu_is_preempted function by moving the
>>> CIF_ENABLED_WAIT test into arch_vcpu_is_preempted.
>>>
>>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>>> ---
>>
>> hi, Christian
>> 	thanks for your patch!
>>
>>>  arch/s390/include/asm/spinlock.h |  3 +++
>>>  arch/s390/kernel/smp.c           |  9 +++++++--
>>>  arch/s390/lib/spinlock.c         | 25 ++++++++-----------------
>>>  3 files changed, 18 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
>>> index 63ebf37..e16e02f 100644
>>> --- a/arch/s390/include/asm/spinlock.h
>>> +++ b/arch/s390/include/asm/spinlock.h
>>> @@ -21,6 +21,9 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
>>>  	return __sync_bool_compare_and_swap(lock, old, new);
>>>  }
>>>
>>> +bool arch_vcpu_is_preempted(int cpu);
>>> +#define vcpu_is_preempted arch_vcpu_is_preempted
>>> +
>>>  /*
>>>   * Simple spin lock operations.  There are two variants, one clears IRQ's
>>>   * on the local processor, one does not.
>>> diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
>>> index 7b89a75..4aadd16 100644
>>> --- a/arch/s390/kernel/smp.c
>>> +++ b/arch/s390/kernel/smp.c
>>> @@ -376,10 +376,15 @@ int smp_find_processor_id(u16 address)
>>>  	return -1;
>>>  }
>>>
>>> -int smp_vcpu_scheduled(int cpu)
>> root@ltcalpine2-lp13:~/linux# git grep -wn smp_vcpu_scheduled arch/s390/
>> arch/s390/include/asm/smp.h:34:extern int smp_vcpu_scheduled(int cpu);
>> arch/s390/include/asm/smp.h:56:static inline int smp_vcpu_scheduled(int cpu) { return 1; }
>> arch/s390/kernel/smp.c:371:int smp_vcpu_scheduled(int cpu)
>> arch/s390/lib/spinlock.c:44:    if (smp_vcpu_scheduled(cpu))
>>
>>> +bool arch_vcpu_is_preempted(int cpu)
>>>  {
>>> -	return pcpu_running(pcpu_devices + cpu);
>>> +	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
>>> +		return false;
>>> +	if (pcpu_running(pcpu_devices + cpu))
>>> +		return false;
>> I saw smp_vcpu_scheduled() returns true always on !SMP system.
>>
>> maybe we can do somegthing silimar. like below
>>
>> #ifndef CONFIG_SMP
>> static inline bool arch_vcpu_is_preempted(int cpu) { return !test_cpu_flag_of(CIF_ENABLED_WAIT, cpu); }
>> #else
>> ...
>>
>> but I can't help thinking that if this is a!SMP system, maybe we could only
>> #ifndef CONFIG_SMP
>> static inline bool arch_vcpu_is_preempted(int cpu) { return false; }
>> #else
>
> Why do we need a vcpu_is_preempted() implementation for UP? Where will
> you use it?
>
yep, I also wonder that :)

But there is a definitaion of smp_vcpu_scheduled() for !SMP kernel.
So I am a little worried that some code has included this spinlock.h for UP kernel also.

Hi, Christian
	Could you help confirms that your patch works on UP? :)

thanks
xinhui

> Regards,
> Boqun
>
>> ...
>>
>>
>> thanks
>> xinhui
>>
>>> +	return true;
>>>  }
>>> +EXPORT_SYMBOL(arch_vcpu_is_preempted);
>>>
>>>  void smp_yield_cpu(int cpu)
>>>  {
>>> diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
>>> index e5f50a7..e48a48e 100644
>>> --- a/arch/s390/lib/spinlock.c
>>> +++ b/arch/s390/lib/spinlock.c
>>> @@ -37,15 +37,6 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
>>>  	asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
>>>  }
>>>
>>> -static inline int cpu_is_preempted(int cpu)
>>> -{
>>> -	if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
>>> -		return 0;
>>> -	if (smp_vcpu_scheduled(cpu))
>>> -		return 0;
>>> -	return 1;
>>> -}
>>> -
>>>  void arch_spin_lock_wait(arch_spinlock_t *lp)
>>>  {
>>>  	unsigned int cpu = SPINLOCK_LOCKVAL;
>>> @@ -62,7 +53,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
>>>  			continue;
>>>  		}
>>>  		/* First iteration: check if the lock owner is running. */
>>> -		if (first_diag && cpu_is_preempted(~owner)) {
>>> +		if (first_diag && arch_vcpu_is_preempted(~owner)) {
>>>  			smp_yield_cpu(~owner);
>>>  			first_diag = 0;
>>>  			continue;
>>> @@ -81,7 +72,7 @@ void arch_spin_lock_wait(arch_spinlock_t *lp)
>>>  		 * yield the CPU unconditionally. For LPAR rely on the
>>>  		 * sense running status.
>>>  		 */
>>> -		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
>>> +		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
>>>  			smp_yield_cpu(~owner);
>>>  			first_diag = 0;
>>>  		}
>>> @@ -108,7 +99,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
>>>  			continue;
>>>  		}
>>>  		/* Check if the lock owner is running. */
>>> -		if (first_diag && cpu_is_preempted(~owner)) {
>>> +		if (first_diag && arch_vcpu_is_preempted(~owner)) {
>>>  			smp_yield_cpu(~owner);
>>>  			first_diag = 0;
>>>  			continue;
>>> @@ -127,7 +118,7 @@ void arch_spin_lock_wait_flags(arch_spinlock_t *lp, unsigned long flags)
>>>  		 * yield the CPU unconditionally. For LPAR rely on the
>>>  		 * sense running status.
>>>  		 */
>>> -		if (!MACHINE_IS_LPAR || cpu_is_preempted(~owner)) {
>>> +		if (!MACHINE_IS_LPAR || arch_vcpu_is_preempted(~owner)) {
>>>  			smp_yield_cpu(~owner);
>>>  			first_diag = 0;
>>>  		}
>>> @@ -165,7 +156,7 @@ void _raw_read_lock_wait(arch_rwlock_t *rw)
>>>  	owner = 0;
>>>  	while (1) {
>>>  		if (count-- <= 0) {
>>> -			if (owner && cpu_is_preempted(~owner))
>>> +			if (owner && arch_vcpu_is_preempted(~owner))
>>>  				smp_yield_cpu(~owner);
>>>  			count = spin_retry;
>>>  		}
>>> @@ -211,7 +202,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw, unsigned int prev)
>>>  	owner = 0;
>>>  	while (1) {
>>>  		if (count-- <= 0) {
>>> -			if (owner && cpu_is_preempted(~owner))
>>> +			if (owner && arch_vcpu_is_preempted(~owner))
>>>  				smp_yield_cpu(~owner);
>>>  			count = spin_retry;
>>>  		}
>>> @@ -241,7 +232,7 @@ void _raw_write_lock_wait(arch_rwlock_t *rw)
>>>  	owner = 0;
>>>  	while (1) {
>>>  		if (count-- <= 0) {
>>> -			if (owner && cpu_is_preempted(~owner))
>>> +			if (owner && arch_vcpu_is_preempted(~owner))
>>>  				smp_yield_cpu(~owner);
>>>  			count = spin_retry;
>>>  		}
>>> @@ -285,7 +276,7 @@ void arch_lock_relax(unsigned int cpu)
>>>  {
>>>  	if (!cpu)
>>>  		return;
>>> -	if (MACHINE_IS_LPAR && !cpu_is_preempted(~cpu))
>>> +	if (MACHINE_IS_LPAR && !arch_vcpu_is_preempted(~cpu))
>>>  		return;
>>>  	smp_yield_cpu(~cpu);
>>>  }
>>>
>>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Paolo Bonzini @ 2016-09-30  6:58 UTC (permalink / raw)
  To: Pan Xinhui
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, will deacon, linux-kernel, Heiko Carstens,
	virtualization, mingo, paulus, mpe, xen-devel-request, paulmck,
	linuxppc-dev
In-Reply-To: <496ba299-1f1d-e98b-7827-f861eeea5558@linux.vnet.ibm.com>

> > > > Please consider s390 and (x86/arm) KVM. Once we have a few, more can
> > > > follow later, but I think its important to not only have PPC support for
> > > > this.
> > >
> > > Actually the s390 preemted check via sigp sense running  is available for
> > > all hypervisors (z/VM, LPAR and KVM) which implies everywhere as you can
> > > no longer buy s390 systems without LPAR.
> > >
> > > As Heiko already pointed out we could simply use a small inline function
> > > that calls cpu_is_preempted from arch/s390/lib/spinlock (or
> > > smp_vcpu_scheduled from smp.c)
> >
> > Sure, and I had vague memories of Heiko's email. This patch set however
> > completely fails to do that trivial hooking up.
> 
> sorry for that.
> I will try to work it out on x86.

x86 has no hypervisor support, and I'd like to understand the desired
semantics first, so I don't think it should block this series.  In
particular, there are at least the following choices:

1) exit to userspace (5-10.000 clock cycles best case) counts as
lock holder preemption

2) any time the vCPU thread not running counts as lock holder
preemption

To implement the latter you'd need a hypercall or MSR (at least as
a slow path), because the KVM preempt notifier is only active
during the KVM_RUN ioctl.

Paolo

^ permalink raw reply

* Re: [PATCH] x86/vmware: Skip lapic calibration on VMware.
From: Thomas Gleixner @ 2016-09-30  8:52 UTC (permalink / raw)
  To: Renat Valiullin
  Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org, Ingo Molnar,
	H. Peter Anvin, Alok Kataria
In-Reply-To: <9FDEBA6F-7CB2-4637-BFC7-EA336B97EDAD@vmware.com>

[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]

On Thu, 29 Sep 2016, Renat Valiullin wrote:
> In virtualized environment the APIC timer calibration could go wrong
> when the host is overcommitted or the guest is running nested,
> this would result in the APIC timers operating at an incorrect frequency.
> Since VMware supports a mechanism to retrieve the local APIC frequency
> we can ask the hypervisor for it and skip this APIC calibration loop.
> 
> Signed-off-by: Renat Valiullin <rvaliullin@vmware.com>
> Acked-by: Alok N Kataria <akataria@vmware.com>
> ---
>  arch/x86/kernel/cpu/vmware.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)

Please fix your mail client so it does not mangle the patch into DOS
format. Aside of that it's white space mangled, i.e. the tabs are converted
to spaces.
 
Please send your patch to yourself, export it to a mbox and apply it with
git am.

> -       if (ebx != UINT_MAX)
> +       if (ebx != UINT_MAX) {
>                 x86_platform.calibrate_tsc = vmware_get_tsc_khz;
> -       else
> +#ifdef CONFIG_X86_LOCAL_APIC
> +               /* Skip lapic calibration since we know the bus frequency. */
> +               lapic_timer_frequency = ecx / HZ;
> +               pr_info("Host bus clock speed read from hypervisor : %u Hz\n",
> +                       ecx);
> +#endif
> +       } else
>                 pr_warn("Failed to get TSC freq from the hypervisor\n");

Please add braces around this as well. See Documentation/Codingstyle

Thanks,

	tglx

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Pan Xinhui @ 2016-09-30  8:52 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, will deacon, linux-kernel, Heiko Carstens,
	virtualization, mingo, paulus, mpe, xen-devel-request, paulmck,
	linuxppc-dev
In-Reply-To: <2136938368.606190.1475218738567.JavaMail.zimbra@redhat.com>


hi, Paolo
	thanks for your reply.

在 2016/9/30 14:58, Paolo Bonzini 写道:
>>>>> Please consider s390 and (x86/arm) KVM. Once we have a few, more can
>>>>> follow later, but I think its important to not only have PPC support for
>>>>> this.
>>>>
>>>> Actually the s390 preemted check via sigp sense running  is available for
>>>> all hypervisors (z/VM, LPAR and KVM) which implies everywhere as you can
>>>> no longer buy s390 systems without LPAR.
>>>>
>>>> As Heiko already pointed out we could simply use a small inline function
>>>> that calls cpu_is_preempted from arch/s390/lib/spinlock (or
>>>> smp_vcpu_scheduled from smp.c)
>>>
>>> Sure, and I had vague memories of Heiko's email. This patch set however
>>> completely fails to do that trivial hooking up.
>>
>> sorry for that.
>> I will try to work it out on x86.
>
> x86 has no hypervisor support, and I'd like to understand the desired
> semantics first, so I don't think it should block this series.  In

Once a guest do a hypercall or something similar, IOW, there is a kvm_guest_exit. we think this is a lock holder preemption.
Adn PPC implement it in this way.

> particular, there are at least the following choices:
>
> 1) exit to userspace (5-10.000 clock cycles best case) counts as
> lock holder preemption
>
just to avoid any misunderstanding.
You are saying that the guest does an IO operation for example and then exit to QEMU right?
Yes, in this scenario it's hard to guarntee that such IO operation or someghing like that could be finished in time.

  
> 2) any time the vCPU thread not running counts as lock holder
> preemption
>
> To implement the latter you'd need a hypercall or MSR (at least as
> a slow path), because the KVM preempt notifier is only active
> during the KVM_RUN ioctl.
>
seems a little expensive. :(
How many clock cycles it might cost.

I am still looking for one shared struct between kvm and guest kernel on x86.
and every time kvm_guest_exit/enter called, we store some info in it. So guest kernel can check one vcpu is running or not quickly.

thanks
xinhui

> Paolo
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Paolo Bonzini @ 2016-09-30  9:08 UTC (permalink / raw)
  To: Pan Xinhui
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, will deacon, linux-kernel, Heiko Carstens,
	virtualization, mingo, paulus, mpe, xen-devel-request, paulmck,
	linuxppc-dev
In-Reply-To: <caabadb6-fe62-aaf7-260f-79f230d03a1c@linux.vnet.ibm.com>



On 30/09/2016 10:52, Pan Xinhui wrote:
>> x86 has no hypervisor support, and I'd like to understand the desired
>> semantics first, so I don't think it should block this series.  In
> 
> Once a guest do a hypercall or something similar, IOW, there is a
> kvm_guest_exit. we think this is a lock holder preemption.
> Adn PPC implement it in this way.

Ok, good.

>> particular, there are at least the following choices:
>>
>> 1) exit to userspace (5-10.000 clock cycles best case) counts as
>> lock holder preemption
>>
>> 2) any time the vCPU thread not running counts as lock holder
>> preemption
>>
>> To implement the latter you'd need a hypercall or MSR (at least as
>> a slow path), because the KVM preempt notifier is only active
>> during the KVM_RUN ioctl.
>
> seems a little expensive. :(
> How many clock cycles it might cost.

An MSR read is about 1500 clock cycles, but it need not be the fast path
(e.g. use a bit to check if the CPU is running, if not use the MSR to
check if the CPU is in userspace but the CPU thread is scheduled).  But
it's not necessary if you are just matching PPC semantics.

Then the simplest thing is to use the kvm_steal_time struct, and add a
new field to it that replaces pad[0].  You can write a 0 to the flag in
record_steal_time (not preempted) and a 1 in kvm_arch_vcpu_put
(preempted).  record_steal_time is called before the VM starts running,
immediately after KVM_RUN and also after every sched_in.

If KVM doesn't implement the flag, it won't touch that field at all.  So
the kernel can write a 0, meaning "not preempted", and not care if the
hypervisor implements the flag or not: the answer will always be safe.

The pointer to the flag can be placed in a per-cpu u32*, and again if
the u32* is NULL that means "not preempted".

Paolo


> I am still looking for one shared struct between kvm and guest kernel on
> x86.
> and every time kvm_guest_exit/enter called, we store some info in it. So
> guest kernel can check one vcpu is running or not quickly.
> 
> thanks
> xinhui
> 
>> Paolo
>>
> 

^ permalink raw reply

* Call for Papers - WorldCIST'17 - 5th World Conference on Information Systems and Technologies (Published by Springer)
From: ML @ 2016-09-30  9:10 UTC (permalink / raw)
  To: virtualization

[-- Attachment #1: Type: text/plain, Size: 7677 bytes --]

*
** Best papers will be published in more than twenty SCI/SSCI-indexed journals
*

---------------------------------------------------------
WorldCIST'17 - 5th World Conference on Information Systems and Technologies 
Porto Santo Island, Madeira, Portugal
11th-13th of April 2017
http://www.worldcist.org/
------------------------------


SCOPE

The WorldCist'17 - 5th World Conference on Information Systems and Technologies, to be held at Porto Santo Island, Madeira, Portugal, 11 - 13 April 2017, is a global forum for researchers and practitioners to present and discuss the most recent innovations, trends, results, experiences and concerns in the several perspectives of Information Systems and Technologies.

We are pleased to invite you to submit your papers to WorldCist'17 (http://www.worldcist.org/). All submissions will be reviewed on the basis of relevance, originality, importance and clarity.


THEMES

Submitted papers should be related with one or more of the main themes proposed for the Conference:

A) Information and Knowledge Management (IKM);
B) Organizational Models and Information Systems (OMIS);
C) Software and Systems Modeling (SSM);
D) Software Systems, Architectures, Applications and Tools (SSAAT);
E) Multimedia Systems and Applications (MSA);
F) Computer Networks, Mobility and Pervasive Systems (CNMPS);
G) Intelligent and Decision Support Systems (IDSS);
H) Big Data Analytics and Applications (BDAA);
I) Human-Computer Interaction (HCI);
J) Ethics, Computers and Security (ECS)
K) Health Informatics (HIS);
L) Information Technologies in Education (ITE);
M) Information Technologies in Radiocommunications (ITR).


TYPES of SUBMISSIONS AND DECISIONS

Four types of papers can be submitted:

- Full paper: Finished or consolidated R&D works, to be included in one of the Conference themes. These papers are assigned a 10-page limit.

- Short paper: Ongoing works with relevant preliminary results, open to discussion. These papers are assigned a 7-page limit.

- Poster paper: Initial work with relevant ideas, open to discussion. These papers are assigned to a 4-page limit.

- Company paper: Companies' papers that show practical experience, R & D, tools, etc., focused on some topics of the conference. These papers are assigned to a 4-page limit.

Submitted papers must comply with the format of Advances in Intelligent Systems and Computing Series (see Instructions for Authors at Springer Website or download a DOC example) be written in English, must not have been published before, not be under review for any other conference or publication and not include any information leading to the authors’ identification. Therefore, the authors’ names, affiliations and bibliographic references should not be included in the version for evaluation by the Program Committee. This information should only be included in the camera-ready version, saved in Word or Latex format and also in PDF format. These files must be accompanied by the Consent to Publication form filled out, in a ZIP file, and uploaded at the conference management system.

All papers will be subjected to a “double-blind review” by at least two members of the Program Committee.

Based on Program Committee evaluation, a paper can be rejected or accepted by the Conference Chairs. In the later case, it can be accepted as the type originally submitted or as another type. Thus, full papers can be accepted as short papers or poster papers only. Similarly, short papers can be accepted as poster papers only. In these cases, the authors will be allowed to maintain the original number of pages in the camera-ready version.

The authors of accepted poster papers must also build and print a poster to be exhibited during the Conference. This poster must follow an A1 or A2 vertical format. The Conference can includes Work Sessions where these posters are presented and orally discussed, with a 5 minute limit per poster.

The authors of accepted full papers will have 15 minutes to present their work in a Conference Work Session; approximately 5 minutes of discussion will follow each presentation. The authors of accepted short papers and company papers will have 11 minutes to present their work in a Conference Work Session; approximately 4 minutes of discussion will follow each presentation.


PUBLICATION & INDEXING

To ensure that a full paper, short paper, poster paper or company paper is published in the Proceedings, at least one of the authors must be fully registered by the 8th of January 2017, and the paper must comply with the suggested layout and page-limit. Additionally, all recommended changes must be addressed by the authors before they submit the camera-ready version.

No more than one paper per registration will be published in the Conference Proceedings. An extra fee must be paid for publication of additional papers, with a maximum of one additional paper per registration. One registration permits only the participation of one author in the conference.

Full and short papers will be published in Proceedings by Springer, in Advances in Intelligent Systems and Computing Series. Poster and company papers will be published by AISTI.

Published full and short papers will be submitted for indexation by ISI, EI-Compendex, SCOPUS, DBLP and Google Scholar, among others, and will be available in the SpringerLink Digital Library.

The authors of the best selected papers will be invited to extend them for publication in international journals indexed by ISI/SCI, SCOPUS and DBLP, among others, such as:

- International Journal of Neural Systems (IF: 6.085 / Q1)
- Integrated Computer-Aided Engineering (IF: 4.981 / Q1)
- International Journal of Information Management (IF: 2.692 / Q1)
- Electronic Commerce Research and Applications (IF: 2.139 / Q1)
- Computers, Environment and Urban Systems (IF: 2.092 / Q1)
- Data Mining and Knowledge Discovery (IF: 1.759 / Q1)
- Journal of Medical Systems (IF: 2.213 / Q2)
- Journal of Business Research (IF: 2.129 / Q2)
- Pervasive and Mobile Computing (IF: 1.719 / Q2)
- Knowledge and Information Systems (IF: 1.702 / Q2)
- Journal of Grid Computing (IF: 1.561 / Q2) - Special Issue on "Big Data"
- Cluster Computing (IF:1.514 / Q2) - Special Issue on "Advanced Machine Learning in Parallel and Distributed Knowledge Discovery"
- International Journal of Critical Infrastructure Protection (IF: 1.351 / Q2)
- Expert Systems - Journal of Knowledge Engineering (IF: 0.947 / Q3)
- Concurrency and Computation: Practice and Experience (IF: 0.942 / Q3)
- Science of Computer Programming (IF: 0.828 / Q3)
- Ethics and Information Technology (IF: 0.739 / Q3)
- Engineering Computations (IF: 0.691 / Q3)
- Advances in Complex Systems (IF: 0.461 / Q3)
- Computing and Informatics (IF: 0.504 / Q4)
- AI Communications (IF: 0.364 / Q4)
- Journal of Hospitality and Tourism Technology (SR: 0.672 / Q2)
- Transforming Government: People, Process and Policy (SR: 0.642 / Q2)
- TEM Journal - Technology, Education, Management, Informatics (ISI - Emerging Sources Citation Index)
- Computer Methods in Biomechanics and Biomedical Engineering - Imaging & Visualization (ISI - Emerging Sources Citation Index)
- Journal of Information Systems Engineering & Management


IMPORTANT DATES

Paper Submission: November 13, 2016

Notification of Acceptance: December 25, 20156

Payment of Registration, to ensure the inclusion of an accepted paper in the conference proceedings: January 8, 2017.

Camera-ready Submission: January 8, 2017


-

Website of WorldCIST'17
http://www.worldcist.org/







[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Pan Xinhui @ 2016-09-30  9:31 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, will deacon, linux-kernel, Heiko Carstens,
	virtualization, mingo, paulus, mpe, xen-devel-request, paulmck,
	linuxppc-dev
In-Reply-To: <f0e8b549-e647-6a01-a93d-9f192adc70c6@redhat.com>



在 2016/9/30 17:08, Paolo Bonzini 写道:
>
>
> On 30/09/2016 10:52, Pan Xinhui wrote:
>>> x86 has no hypervisor support, and I'd like to understand the desired
>>> semantics first, so I don't think it should block this series.  In
>>
>> Once a guest do a hypercall or something similar, IOW, there is a
>> kvm_guest_exit. we think this is a lock holder preemption.
>> Adn PPC implement it in this way.
>
> Ok, good.
>
>>> particular, there are at least the following choices:
>>>
>>> 1) exit to userspace (5-10.000 clock cycles best case) counts as
>>> lock holder preemption
>>>
>>> 2) any time the vCPU thread not running counts as lock holder
>>> preemption
>>>
>>> To implement the latter you'd need a hypercall or MSR (at least as
>>> a slow path), because the KVM preempt notifier is only active
>>> during the KVM_RUN ioctl.
>>
>> seems a little expensive. :(
>> How many clock cycles it might cost.
>
> An MSR read is about 1500 clock cycles, but it need not be the fast path
> (e.g. use a bit to check if the CPU is running, if not use the MSR to
> check if the CPU is in userspace but the CPU thread is scheduled).  But
> it's not necessary if you are just matching PPC semantics.
>
> Then the simplest thing is to use the kvm_steal_time struct, and add a
> new field to it that replaces pad[0].  You can write a 0 to the flag in
> record_steal_time (not preempted) and a 1 in kvm_arch_vcpu_put
> (preempted).  record_steal_time is called before the VM starts running,
> immediately after KVM_RUN and also after every sched_in.
>
> If KVM doesn't implement the flag, it won't touch that field at all.  So
> the kernel can write a 0, meaning "not preempted", and not care if the
> hypervisor implements the flag or not: the answer will always be safe.
>
> The pointer to the flag can be placed in a per-cpu u32*, and again if
> the u32* is NULL that means "not preempted".
>
really nice suggestion!  That's what I want :)

thanks
xinhui

> Paolo
>
>
>> I am still looking for one shared struct between kvm and guest kernel on
>> x86.
>> and every time kvm_guest_exit/enter called, we store some info in it. So
>> guest kernel can check one vcpu is running or not quickly.
>>
>> thanks
>> xinhui
>>
>>> Paolo
>>>
>>
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply

* Re: [PATCH v2 1/1] s390/spinlock: Provide vcpu_is_preempted
From: Christian Borntraeger @ 2016-09-30 10:29 UTC (permalink / raw)
  To: Pan Xinhui, Peter Zijlstra, Martin Schwidefsky, Heiko Carstens
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Pan Xinhui, will.deacon,
	linux-kernel, virtualization, mingo, paulus, mpe,
	xen-devel-request, pbonzini, paulmck
In-Reply-To: <b2ace794-c1cc-11be-f9f5-d6429e192825@linux.vnet.ibm.com>

On 09/30/2016 06:49 AM, Pan Xinhui wrote:

> 
> but I can't help thinking that if this is a!SMP system, maybe we could only
> #ifndef CONFIG_SMP
> static inline bool arch_vcpu_is_preempted(int cpu) { return false; }
> #else

Yes, I will add that to v3. Thanks for spotting.

^ permalink raw reply

* Re: [PATCH v3 0/4] implement vcpu preempted check
From: Christian Borntraeger @ 2016-09-30 10:44 UTC (permalink / raw)
  To: Paolo Bonzini, Pan Xinhui
  Cc: kernellwp, linux-s390, benh, jgross, kvm, Peter Zijlstra,
	Pan Xinhui, will deacon, linux-kernel, Heiko Carstens,
	virtualization, mingo, paulus, mpe, xen-devel-request, paulmck,
	linuxppc-dev
In-Reply-To: <2136938368.606190.1475218738567.JavaMail.zimbra@redhat.com>

On 09/30/2016 08:58 AM, Paolo Bonzini wrote:
>>>>> Please consider s390 and (x86/arm) KVM. Once we have a few, more can
>>>>> follow later, but I think its important to not only have PPC support for
>>>>> this.
>>>>
>>>> Actually the s390 preemted check via sigp sense running  is available for
>>>> all hypervisors (z/VM, LPAR and KVM) which implies everywhere as you can
>>>> no longer buy s390 systems without LPAR.
>>>>
>>>> As Heiko already pointed out we could simply use a small inline function
>>>> that calls cpu_is_preempted from arch/s390/lib/spinlock (or
>>>> smp_vcpu_scheduled from smp.c)
>>>
>>> Sure, and I had vague memories of Heiko's email. This patch set however
>>> completely fails to do that trivial hooking up.
>>
>> sorry for that.
>> I will try to work it out on x86.
> 
> x86 has no hypervisor support, and I'd like to understand the desired
> semantics first, so I don't think it should block this series.  In
> particular, there are at least the following choices:

I think the semantics can be slightly different for different architectures
after all it is still a heuristics to improve performance.
> 
> 1) exit to userspace (5-10.000 clock cycles best case) counts as
> lock holder preemption
> 
> 2) any time the vCPU thread not running counts as lock holder
> preemption
> 
> To implement the latter you'd need a hypercall or MSR (at least as
> a slow path), because the KVM preempt notifier is only active
> during the KVM_RUN ioctl.

FWIW, The s390 implementation uses kvm_arch_vcpu_put/load as trigger
points for (un)setting the CPUSTAT_RUNNING. Strictly speaking an exit to
userspace is not preempted, But as KVM has no control if we are being
scheduled out when in QEMU this is the compromise that seems to work quite
well for the s390 spinlock code (which checks the running state before 
doing a yield hypercall). 
In addition an exit to QEMU is really a rare case.

^ permalink raw reply

* Re: [PATCH 4/4] virtio_blk: Rename a jump label in virtblk_get_id()
From: Stefan Hajnoczi @ 2016-10-03  9:07 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: Julia Lawall, Michael S. Tsirkin, kernel-janitors, LKML,
	Linux Virtualization
In-Reply-To: <a303f7a6-c675-5228-99bd-a03c9e9252e9@users.sourceforge.net>

On Tue, Sep 13, 2016 at 1:15 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 13 Sep 2016 13:50:56 +0200
>
> Adjust a jump label according to the current Linux coding style convention.

I think you mean "goto label".  "Jump label" has a different meaning,
see <linux/jump_label.h>.

> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/block/virtio_blk.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index 696f452..fef2bd0 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -247,10 +247,10 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
>
>         err = blk_rq_map_kern(q, req, id_str, VIRTIO_BLK_ID_BYTES, GFP_KERNEL);
>         if (err)
> -               goto out;
> +               goto put_request;
>
>         err = blk_execute_rq(vblk->disk->queue, vblk->disk, req, false);
> -out:
> + put_request:

I checked Documentation/CodingStyle and see no reason to rename the label.

It's also not clear why you added a space.  The CodingStyle example
does not use a space before the label.

^ permalink raw reply

* Re: [PATCH 3/4] virtio_blk: Delete an unnecessary initialisation in init_vq()
From: Stefan Hajnoczi @ 2016-10-03  9:09 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: Julia Lawall, Michael S. Tsirkin, kernel-janitors, LKML,
	Linux Virtualization
In-Reply-To: <52a07fc8-21a0-8f98-fa9d-5751fbf95afa@users.sourceforge.net>

On Tue, Sep 13, 2016 at 1:14 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 13 Sep 2016 13:43:50 +0200
>
> The local variable "err" will be set to an appropriate value
> by a following statement.
> Thus omit the explicit initialisation at the beginning.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/block/virtio_blk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
> index d28dbcf..696f452 100644
> --- a/drivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -376,7 +376,7 @@ static void virtblk_config_changed(struct virtio_device *vdev)
>
>  static int init_vq(struct virtio_blk *vblk)
>  {
> -       int err = 0;
> +       int err;
>         int i;
>         vq_callback_t **callbacks;
>         const char **names;

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply

* Re: [PATCH 1/4] virtio_blk: Use kmalloc_array() in init_vq()
From: Stefan Hajnoczi @ 2016-10-03  9:11 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: Julia Lawall, Michael S. Tsirkin, kernel-janitors, LKML,
	Linux Virtualization
In-Reply-To: <7a8dd874-3700-1445-2143-2a604cd043ab@users.sourceforge.net>

On Tue, Sep 13, 2016 at 1:12 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Tue, 13 Sep 2016 11:32:22 +0200
>
> Multiplications for the size determination of memory allocations
> indicated that array data structures should be processed.
> Thus use the corresponding function "kmalloc_array".
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/block/virtio_blk.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox