Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-28 Thread xinhui
On 2016年06月28日 15:00, Heiko Carstens wrote: On Mon, Jun 27, 2016 at 04:00:43PM +0200, Peter Zijlstra wrote: On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: +++ b/include/linux/sched.h @@ -3293,6 +3293,15 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)

Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-28 Thread Heiko Carstens
On Mon, Jun 27, 2016 at 04:00:43PM +0200, Peter Zijlstra wrote: > On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: > > +++ b/include/linux/sched.h > > @@ -3293,6 +3293,15 @@ static inline void set_task_cpu(struct task_struct > > *p, unsigned int cpu) > > > > #endif /* CONFIG_SMP */ >

Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-27 Thread xinhui
On 2016年06月27日 22:05, Boqun Feng wrote: On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: this supports to fix lock holder preempted issue which run as a guest for kernel users, we could use bool vcpu_is_preempted(int cpu) to detech if one vcpu is preempted or not. The default impl

Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-27 Thread xinhui
On 2016年06月27日 22:02, Peter Zijlstra wrote: On Mon, Jun 27, 2016 at 04:00:43PM +0200, Peter Zijlstra wrote: On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: +++ b/include/linux/sched.h @@ -3293,6 +3293,15 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)

Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-27 Thread Peter Zijlstra
On Mon, Jun 27, 2016 at 04:00:43PM +0200, Peter Zijlstra wrote: > On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: > > +++ b/include/linux/sched.h > > @@ -3293,6 +3293,15 @@ static inline void set_task_cpu(struct task_struct > > *p, unsigned int cpu) > > > > #endif /* CONFIG_SMP */ >

Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-27 Thread Boqun Feng
On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: > this supports to fix lock holder preempted issue which run as a guest > > for kernel users, we could use bool vcpu_is_preempted(int cpu) to detech > if one vcpu is preempted or not. > > The default implementation is a macrodefined by f

Re: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-27 Thread Peter Zijlstra
On Mon, Jun 27, 2016 at 01:41:28PM -0400, Pan Xinhui wrote: > +++ b/include/linux/sched.h > @@ -3293,6 +3293,15 @@ static inline void set_task_cpu(struct task_struct *p, > unsigned int cpu) > > #endif /* CONFIG_SMP */ > > +#ifdef arch_vcpu_is_preempted > +static inline bool vcpu_is_preempted(

[PATCH 1/3] kernel/sched: introduce vcpu preempted check interface

2016-06-27 Thread Pan Xinhui
this supports to fix lock holder preempted issue which run as a guest for kernel users, we could use bool vcpu_is_preempted(int cpu) to detech if one vcpu is preempted or not. The default implementation is a macrodefined by false. So compiler can wrap it out if arch dose not support such vcpu pte