Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-09-01 Thread Jan Beulich
>>> On 01.09.17 at 11:55, wrote: On 01.09.17 at 10:37, wrote: >> it seems add_sized() won't be a LOCKed instruction. >> #define build_add_sized(name, size, type, reg) \ >> static inline void name(volatile type *addr, type val) \ >> {

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-09-01 Thread Jan Beulich
>>> On 01.09.17 at 10:37, wrote: > it seems add_sized() won't be a LOCKed instruction. > #define build_add_sized(name, size, type, reg) \ > static inline void name(volatile type *addr, type val) \ > { \ >

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-09-01 Thread Chao Gao
On Fri, Sep 01, 2017 at 03:13:17AM -0600, Jan Beulich wrote: On 01.09.17 at 09:55, wrote: >> On Fri, Sep 01, 2017 at 02:24:08AM -0600, Jan Beulich wrote: >> On 01.09.17 at 03:39, wrote: After thinking it again, I want to define the counter as a unsigned int variable for the fol

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-09-01 Thread Jan Beulich
>>> On 01.09.17 at 09:55, wrote: > On Fri, Sep 01, 2017 at 02:24:08AM -0600, Jan Beulich wrote: > On 01.09.17 at 03:39, wrote: >>> After thinking it again, I want to define the counter as >>> a unsigned int variable for the following reasion: >>> 1. It is definite that the counter is closely

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-09-01 Thread Chao Gao
On Fri, Sep 01, 2017 at 02:24:08AM -0600, Jan Beulich wrote: On 01.09.17 at 03:39, wrote: >> After thinking it again, I want to define the counter as >> a unsigned int variable for the following reasion: >> 1. It is definite that the counter is closely related with >> list_add() and list_del(

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-09-01 Thread Jan Beulich
>>> On 01.09.17 at 03:39, wrote: > After thinking it again, I want to define the counter as > a unsigned int variable for the following reasion: > 1. It is definite that the counter is closely related with > list_add() and list_del(). If the list is protected by the > lock, it is straightforward t

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-31 Thread Chao Gao
On Thu, Aug 31, 2017 at 02:33:57AM -0600, Jan Beulich wrote: On 31.08.17 at 09:15, wrote: >> On Thu, Aug 31, 2017 at 01:42:53AM -0600, Jan Beulich wrote: >> On 31.08.17 at 00:57, wrote: On Wed, Aug 30, 2017 at 10:00:49AM -0600, Jan Beulich wrote: On 16.08.17 at 07:14, wrot

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-31 Thread Chao Gao
On Thu, Aug 31, 2017 at 02:33:57AM -0600, Jan Beulich wrote: On 31.08.17 at 09:15, wrote: >> On Thu, Aug 31, 2017 at 01:42:53AM -0600, Jan Beulich wrote: >> On 31.08.17 at 00:57, wrote: On Wed, Aug 30, 2017 at 10:00:49AM -0600, Jan Beulich wrote: On 16.08.17 at 07:14, wrot

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-31 Thread Jan Beulich
>>> On 31.08.17 at 09:15, wrote: > On Thu, Aug 31, 2017 at 01:42:53AM -0600, Jan Beulich wrote: > On 31.08.17 at 00:57, wrote: >>> On Wed, Aug 30, 2017 at 10:00:49AM -0600, Jan Beulich wrote: >>> On 16.08.17 at 07:14, wrote: > @@ -100,6 +101,24 @@ void vmx_pi_per_cpu_init(unsigned in

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-31 Thread Chao Gao
On Thu, Aug 31, 2017 at 01:42:53AM -0600, Jan Beulich wrote: On 31.08.17 at 00:57, wrote: >> On Wed, Aug 30, 2017 at 10:00:49AM -0600, Jan Beulich wrote: >> On 16.08.17 at 07:14, wrote: @@ -100,6 +101,24 @@ void vmx_pi_per_cpu_init(unsigned int cpu) spin_lock_init(&per_cpu

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-31 Thread Jan Beulich
>>> On 31.08.17 at 00:57, wrote: > On Wed, Aug 30, 2017 at 10:00:49AM -0600, Jan Beulich wrote: > On 16.08.17 at 07:14, wrote: >>> @@ -100,6 +101,24 @@ void vmx_pi_per_cpu_init(unsigned int cpu) >>> spin_lock_init(&per_cpu(vmx_pi_blocking, cpu).lock); >>> } >>> >>> +static void vmx_pi

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-30 Thread Chao Gao
On Wed, Aug 30, 2017 at 10:00:49AM -0600, Jan Beulich wrote: On 16.08.17 at 07:14, wrote: >> @@ -100,6 +101,24 @@ void vmx_pi_per_cpu_init(unsigned int cpu) >> spin_lock_init(&per_cpu(vmx_pi_blocking, cpu).lock); >> } >> >> +static void vmx_pi_add_vcpu(struct pi_blocking_vcpu *pbv, >>

Re: [Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-30 Thread Jan Beulich
>>> On 16.08.17 at 07:14, wrote: > @@ -100,6 +101,24 @@ void vmx_pi_per_cpu_init(unsigned int cpu) > spin_lock_init(&per_cpu(vmx_pi_blocking, cpu).lock); > } > > +static void vmx_pi_add_vcpu(struct pi_blocking_vcpu *pbv, > +struct vmx_pi_blocking_vcpu *vpbv) > +

[Xen-devel] [PATCH v5 1/4] VT-d PI: track the number of vcpus on pi blocking list

2017-08-15 Thread Chao Gao
This patch adds a field, counter, in struct vmx_pi_blocking_vcpu to track how many entries are on the pi blocking list. Signed-off-by: Chao Gao --- v5: - introduce two functions for adding or removing vcpus from pi blocking list. - check the sanity of vcpu count on pi blocking list v4: - non-t