Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Tim Deegan
At 18:21 +0200 on 14 Aug (1502734919), Dario Faggioli wrote: > On Mon, 2017-08-14 at 14:54 +0100, Tim Deegan wrote: > > At 15:24 +0200 on 14 Aug (1502724279), Dario Faggioli wrote: > > > About the former... I'm not sure which check of rcp->cur you're > > > referring to. I think it's the one in

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Dario Faggioli
On Mon, 2017-08-14 at 14:54 +0100, Tim Deegan wrote: > At 15:24 +0200 on 14 Aug (1502724279), Dario Faggioli wrote: > > About the former... I'm not sure which check of rcp->cur you're > > referring to. I think it's the one in rcu_check_quiescent_state(), > > but > > then, I'm not sure where to

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Tim Deegan
Hi, At 15:24 +0200 on 14 Aug (1502724279), Dario Faggioli wrote: > On Mon, 2017-08-14 at 11:39 +0100, Tim Deegan wrote: > > At 11:19 +0200 on 14 Aug (1502709563), Dario Faggioli wrote: > > > 3) CPU2 is not in idle_cpumask, and so it will not be in the > > > sampled > > > mask, but the first check

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Dario Faggioli
On Mon, 2017-08-14 at 11:39 +0100, Tim Deegan wrote: > Hi, > Hey, > At 11:19 +0200 on 14 Aug (1502709563), Dario Faggioli wrote: > > Therefore, it looks to me that the race can be avoided by making > > sure > > that there is at least one check of rcu_pending(), after a CPU has > > called

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Tim Deegan
Hi, At 11:19 +0200 on 14 Aug (1502709563), Dario Faggioli wrote: > Basically, for the race to occur (in [3]), it is necessary that [2] > (CPU1 doing rcp->cur++) happens after [1] (last call to rcu_pending() > of CPU2, before clearing the mask and going idle). In fact, it that is > not the case,

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-14 Thread Dario Faggioli
On Wed, 2017-08-09 at 12:38 +0100, Tim Deegan wrote: > Hi, > > At 10:01 +0200 on 27 Jul (1501149684), Dario Faggioli wrote: > > In Xen, that is impossible, and that's particularly problematic > > when system is idle (or lightly loaded) systems, as CPUs that > > are idle may never have the chance

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-11 Thread Dario Faggioli
On Wed, 2017-08-09 at 12:38 +0100, Tim Deegan wrote: > Hi, > Hey! :-) > At 10:01 +0200 on 27 Jul (1501149684), Dario Faggioli wrote: > > In Xen, that is impossible, and that's particularly problematic > > when system is idle (or lightly loaded) systems, as CPUs that > > are idle may never have

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-09 Thread Tim Deegan
Hi, At 10:01 +0200 on 27 Jul (1501149684), Dario Faggioli wrote: > In Xen, that is impossible, and that's particularly problematic > when system is idle (or lightly loaded) systems, as CPUs that > are idle may never have the chance to tell RCU about their > quiescence, and grace periods could

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-09 Thread Jan Beulich
>>> On 09.08.17 at 11:20, wrote: > On Wed, 2017-08-09 at 02:57 -0600, Jan Beulich wrote: >> > > > On 09.08.17 at 10:48, wrote: >> > >> > _I_think_ what the original author meant was something along the >> > line >> > of > > unsafe.

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-09 Thread Dario Faggioli
On Wed, 2017-08-09 at 02:57 -0600, Jan Beulich wrote: > > > > On 09.08.17 at 10:48, wrote: > > > > _I_think_ what the original author meant was something along the > > line > > of > unsafe. > > Therefore, let's access it afterwords, and put a barrier in > >

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-09 Thread Jan Beulich
>>> On 09.08.17 at 10:48, wrote: > On Mon, 2017-08-07 at 02:35 -0600, Jan Beulich wrote: >> > > > Dario Faggioli 07/27/17 10:01 AM >> > @@ -248,7 +249,14 @@ static void rcu_start_batch(struct rcu_ctrlblk >> > *rcp) >> > smp_wmb(); >> >

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-09 Thread Dario Faggioli
On Mon, 2017-08-07 at 02:35 -0600, Jan Beulich wrote: > > > > Dario Faggioli 07/27/17 10:01 AM > > > > >>> > > --- a/xen/arch/x86/acpi/cpu_idle.c > > +++ b/xen/arch/x86/acpi/cpu_idle.c > > > > @@ -433,12 +435,14 @@ static void acpi_idle_do_entry(struct > >

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-08-07 Thread Jan Beulich
>>> Dario Faggioli 07/27/17 10:01 AM >>> >--- a/xen/arch/x86/acpi/cpu_idle.c >+++ b/xen/arch/x86/acpi/cpu_idle.c >@@ -418,14 +418,16 @@ static void acpi_processor_ffh_cstate_enter(struct >acpi_processor_cx *cx) >mwait_idle_with_hints(cx->address,

Re: [Xen-devel] [PATCH 3/5] xen: RCU/x86/ARM: discount CPUs that were idle when grace period started.

2017-07-31 Thread Stefano Stabellini
On Thu, 27 Jul 2017, Dario Faggioli wrote: > Xen is a tickless (micro-)kernel. This means that, when a CPU > becomes idle, we stop all the activity on it, including any > periodic tick or timer. > > When we imported RCU from Linux, Linux (x86) was a ticking > kernel, i.e., there was a periodic