Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-23 Thread Paul E. McKenney
On Mon, Jul 23, 2018 at 10:08:59AM +0200, David Woodhouse wrote: > On Thu, 2018-07-19 at 10:09 -0700, Paul E. McKenney wrote: > > > > Of course, the real reason for the lack of fault on your part will not > > because I believe I found the bug elsewhere, but instead because I will > > be dropping

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-23 Thread Paul E. McKenney
On Mon, Jul 23, 2018 at 10:08:59AM +0200, David Woodhouse wrote: > On Thu, 2018-07-19 at 10:09 -0700, Paul E. McKenney wrote: > > > > Of course, the real reason for the lack of fault on your part will not > > because I believe I found the bug elsewhere, but instead because I will > > be dropping

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-23 Thread David Woodhouse
On Thu, 2018-07-19 at 10:09 -0700, Paul E. McKenney wrote: > > Of course, the real reason for the lack of fault on your part will not > because I believe I found the bug elsewhere, but instead because I will > be dropping your patch (and mine as well) on Frederic's advice.  ;-) You're keeping

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-23 Thread David Woodhouse
On Thu, 2018-07-19 at 10:09 -0700, Paul E. McKenney wrote: > > Of course, the real reason for the lack of fault on your part will not > because I believe I found the bug elsewhere, but instead because I will > be dropping your patch (and mine as well) on Frederic's advice.  ;-) You're keeping

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Paul E. McKenney
On Wed, Jul 18, 2018 at 09:37:12AM -0700, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > > And I finally did get some near misses from an earlier commit, so we > > > should consider your

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Paul E. McKenney
On Wed, Jul 18, 2018 at 09:37:12AM -0700, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > > And I finally did get some near misses from an earlier commit, so we > > > should consider your

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread David Woodhouse
On Thu, 2018-07-19 at 15:14 +0200, Frederic Weisbecker wrote: > > I'm not sure about the context tracking condition in the code snippet > > cited above, though. I think that's what caused my problem in the first > > place — I have CONTEXT_TRACKING_FORCE && !NO_HZ_FULL. So in 4.15, that > > means

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread David Woodhouse
On Thu, 2018-07-19 at 15:14 +0200, Frederic Weisbecker wrote: > > I'm not sure about the context tracking condition in the code snippet > > cited above, though. I think that's what caused my problem in the first > > place — I have CONTEXT_TRACKING_FORCE && !NO_HZ_FULL. So in 4.15, that > > means

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Frederic Weisbecker
On Thu, Jul 19, 2018 at 08:16:47AM +0200, David Woodhouse wrote: > > > On Wed, 2018-07-18 at 20:11 -0700, Paul E. McKenney wrote: > > > > > That is interesting. As I replied to Paul, we are already calling > > > rcu_user_enter/exit() on guest_enter/exit_irqsoff(). So I'm wondering why > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Frederic Weisbecker
On Thu, Jul 19, 2018 at 08:16:47AM +0200, David Woodhouse wrote: > > > On Wed, 2018-07-18 at 20:11 -0700, Paul E. McKenney wrote: > > > > > That is interesting. As I replied to Paul, we are already calling > > > rcu_user_enter/exit() on guest_enter/exit_irqsoff(). So I'm wondering why > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Frederic Weisbecker
On Wed, Jul 18, 2018 at 08:11:52PM -0700, Paul E. McKenney wrote: > On Thu, Jul 19, 2018 at 02:32:06AM +0200, Frederic Weisbecker wrote: > > On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > > > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > > > And here is an

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Frederic Weisbecker
On Wed, Jul 18, 2018 at 08:11:52PM -0700, Paul E. McKenney wrote: > On Thu, Jul 19, 2018 at 02:32:06AM +0200, Frederic Weisbecker wrote: > > On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > > > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > > > And here is an

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Frederic Weisbecker
On Thu, Jul 19, 2018 at 09:20:33AM +0200, David Woodhouse wrote: > On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: > > > > > My thought would be something like this: > > >  > > >   if (context_tracking_cpu_is_enabled()) > > >   rcu_kvm_enter(); > > >   else > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Frederic Weisbecker
On Thu, Jul 19, 2018 at 09:20:33AM +0200, David Woodhouse wrote: > On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: > > > > > My thought would be something like this: > > >  > > >   if (context_tracking_cpu_is_enabled()) > > >   rcu_kvm_enter(); > > >   else > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Paul E. McKenney
On Thu, Jul 19, 2018 at 12:23:34PM +0200, Christian Borntraeger wrote: > > > On 07/19/2018 09:20 AM, David Woodhouse wrote: > > On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: > >> > >>> My thought would be something like this: > >>>   > >>>    if

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Paul E. McKenney
On Thu, Jul 19, 2018 at 12:23:34PM +0200, Christian Borntraeger wrote: > > > On 07/19/2018 09:20 AM, David Woodhouse wrote: > > On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: > >> > >>> My thought would be something like this: > >>>   > >>>    if

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Christian Borntraeger
On 07/19/2018 09:20 AM, David Woodhouse wrote: > On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: >> >>> My thought would be something like this: >>>   >>>    if (context_tracking_cpu_is_enabled()) >>>    rcu_kvm_enter(); >>>    else >>>    

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Christian Borntraeger
On 07/19/2018 09:20 AM, David Woodhouse wrote: > On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: >> >>> My thought would be something like this: >>>   >>>    if (context_tracking_cpu_is_enabled()) >>>    rcu_kvm_enter(); >>>    else >>>    

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread David Woodhouse
On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: > > > My thought would be something like this: > >  > >   if (context_tracking_cpu_is_enabled()) > >   rcu_kvm_enter(); > >   else > >   rcu_virt_note_context_switch(smp_processor_id()); > > In the

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread David Woodhouse
On Wed, 2018-07-18 at 20:11 -0700, Paul E. McKenney wrote: > > > That is interesting. As I replied to Paul, we are already calling > > rcu_user_enter/exit() on guest_enter/exit_irqsoff(). So I'm wondering why > > you're seeing such an optimization by repeating those calls. > >  > > Perhaps the

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread David Woodhouse
On Thu, 2018-07-19 at 08:45 +0200, Christian Borntraeger wrote: > > > My thought would be something like this: > >  > >   if (context_tracking_cpu_is_enabled()) > >   rcu_kvm_enter(); > >   else > >   rcu_virt_note_context_switch(smp_processor_id()); > > In the

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread David Woodhouse
On Wed, 2018-07-18 at 20:11 -0700, Paul E. McKenney wrote: > > > That is interesting. As I replied to Paul, we are already calling > > rcu_user_enter/exit() on guest_enter/exit_irqsoff(). So I'm wondering why > > you're seeing such an optimization by repeating those calls. > >  > > Perhaps the

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Christian Borntraeger
On 07/18/2018 10:17 PM, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 09:41:05PM +0200, David Woodhouse wrote: >> >> >> On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: >>> On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: On Wed, 2018-07-18 at 08:36

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-19 Thread Christian Borntraeger
On 07/18/2018 10:17 PM, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 09:41:05PM +0200, David Woodhouse wrote: >> >> >> On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: >>> On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: On Wed, 2018-07-18 at 08:36

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Thu, Jul 19, 2018 at 02:32:06AM +0200, Frederic Weisbecker wrote: > On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > > And here is an updated v4.15 patch with Marius's Reported-by and David's > > > fix to my lost

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Thu, Jul 19, 2018 at 02:32:06AM +0200, Frederic Weisbecker wrote: > On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > > And here is an updated v4.15 patch with Marius's Reported-by and David's > > > fix to my lost

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Frederic Weisbecker
On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > And here is an updated v4.15 patch with Marius's Reported-by and David's > > fix to my lost exclamation point. > > Thanks. Are you sending the original version of that

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Frederic Weisbecker
On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > And here is an updated v4.15 patch with Marius's Reported-by and David's > > fix to my lost exclamation point. > > Thanks. Are you sending the original version of that

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Frederic Weisbecker
On Wed, Jul 18, 2018 at 01:17:00PM -0700, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 09:41:05PM +0200, David Woodhouse wrote: > > > > > > On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: > > > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > > > > > > > On

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Frederic Weisbecker
On Wed, Jul 18, 2018 at 01:17:00PM -0700, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 09:41:05PM +0200, David Woodhouse wrote: > > > > > > On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: > > > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > > > > > > > On

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Wed, Jul 18, 2018 at 09:41:05PM +0200, David Woodhouse wrote: > > > On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: > > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > > > > > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > > > > > > > And I

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Wed, Jul 18, 2018 at 09:41:05PM +0200, David Woodhouse wrote: > > > On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: > > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > > > > > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > > > > > > > And I

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread David Woodhouse
On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > > > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > > > > > And I finally did get some near misses from an earlier commit, so we > > > should

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread David Woodhouse
On Wed, 2018-07-18 at 09:37 -0700, Paul E. McKenney wrote: > On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > > > > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > > > > > And I finally did get some near misses from an earlier commit, so we > > > should

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > And I finally did get some near misses from an earlier commit, so we > > should consider your patch to be officially off the hook. > > Yay, I like it when it's not my

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Wed, Jul 18, 2018 at 06:01:51PM +0200, David Woodhouse wrote: > On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > > And I finally did get some near misses from an earlier commit, so we > > should consider your patch to be officially off the hook. > > Yay, I like it when it's not my

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread David Woodhouse
On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > And I finally did get some near misses from an earlier commit, so we > should consider your patch to be officially off the hook. Yay, I like it when it's not my fault. I'll redo it with the ifdef CONFIG_NO_HZ_FULL. What should it do

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread David Woodhouse
On Wed, 2018-07-18 at 08:36 -0700, Paul E. McKenney wrote: > And I finally did get some near misses from an earlier commit, so we > should consider your patch to be officially off the hook. Yay, I like it when it's not my fault. I'll redo it with the ifdef CONFIG_NO_HZ_FULL. What should it do

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Tue, Jul 17, 2018 at 05:56:53AM -0700, Paul E. McKenney wrote: > On Tue, Jul 17, 2018 at 10:19:08AM +0200, David Woodhouse wrote: > > On Mon, 2018-07-16 at 08:40 -0700, Paul E. McKenney wrote: > > > Most of the weekend was devoted to testing today's upcoming pull request, > > > but I did get a

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-18 Thread Paul E. McKenney
On Tue, Jul 17, 2018 at 05:56:53AM -0700, Paul E. McKenney wrote: > On Tue, Jul 17, 2018 at 10:19:08AM +0200, David Woodhouse wrote: > > On Mon, 2018-07-16 at 08:40 -0700, Paul E. McKenney wrote: > > > Most of the weekend was devoted to testing today's upcoming pull request, > > > but I did get a

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-17 Thread Paul E. McKenney
On Tue, Jul 17, 2018 at 10:19:08AM +0200, David Woodhouse wrote: > On Mon, 2018-07-16 at 08:40 -0700, Paul E. McKenney wrote: > > Most of the weekend was devoted to testing today's upcoming pull request, > > but I did get a bit more testing done on this. > > > > I was able to make this happen

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-17 Thread Paul E. McKenney
On Tue, Jul 17, 2018 at 10:19:08AM +0200, David Woodhouse wrote: > On Mon, 2018-07-16 at 08:40 -0700, Paul E. McKenney wrote: > > Most of the weekend was devoted to testing today's upcoming pull request, > > but I did get a bit more testing done on this. > > > > I was able to make this happen

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-17 Thread David Woodhouse
On Mon, 2018-07-16 at 08:40 -0700, Paul E. McKenney wrote: > Most of the weekend was devoted to testing today's upcoming pull request, > but I did get a bit more testing done on this. > > I was able to make this happen more often by tweaking rcutorture a > bit, but I still do not yet have

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-17 Thread David Woodhouse
On Mon, 2018-07-16 at 08:40 -0700, Paul E. McKenney wrote: > Most of the weekend was devoted to testing today's upcoming pull request, > but I did get a bit more testing done on this. > > I was able to make this happen more often by tweaking rcutorture a > bit, but I still do not yet have

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-16 Thread Paul E. McKenney
On Thu, Jul 12, 2018 at 09:17:04AM -0700, Paul E. McKenney wrote: > On Thu, Jul 12, 2018 at 05:53:51AM -0700, Paul E. McKenney wrote: > > On Thu, Jul 12, 2018 at 01:00:42PM +0100, David Woodhouse wrote: > > > > > > > > > On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > > > > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-16 Thread Paul E. McKenney
On Thu, Jul 12, 2018 at 09:17:04AM -0700, Paul E. McKenney wrote: > On Thu, Jul 12, 2018 at 05:53:51AM -0700, Paul E. McKenney wrote: > > On Thu, Jul 12, 2018 at 01:00:42PM +0100, David Woodhouse wrote: > > > > > > > > > On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > > > > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-12 Thread Paul E. McKenney
On Thu, Jul 12, 2018 at 05:53:51AM -0700, Paul E. McKenney wrote: > On Thu, Jul 12, 2018 at 01:00:42PM +0100, David Woodhouse wrote: > > > > > > On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > > > > > Also... why in $DEITY's name was the existing > > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-12 Thread Paul E. McKenney
On Thu, Jul 12, 2018 at 05:53:51AM -0700, Paul E. McKenney wrote: > On Thu, Jul 12, 2018 at 01:00:42PM +0100, David Woodhouse wrote: > > > > > > On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > > > > > Also... why in $DEITY's name was the existing > > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-12 Thread Paul E. McKenney
On Thu, Jul 12, 2018 at 01:00:42PM +0100, David Woodhouse wrote: > > > On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > > > Also... why in $DEITY's name was the existing > > > rcu_virt_note_context_switch() not actually sufficient? If we had that > > > there, why did we need an

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-12 Thread Paul E. McKenney
On Thu, Jul 12, 2018 at 01:00:42PM +0100, David Woodhouse wrote: > > > On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > > > Also... why in $DEITY's name was the existing > > > rcu_virt_note_context_switch() not actually sufficient? If we had that > > > there, why did we need an

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-12 Thread David Woodhouse
On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > Also... why in $DEITY's name was the existing > > rcu_virt_note_context_switch() not actually sufficient? If we had that > > there, why did we need an additional explicit calls to rcu_all_qs() in > > the KVM loop, or the more

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-12 Thread David Woodhouse
On Wed, 2018-07-11 at 14:08 -0700, Paul E. McKenney wrote: > > > Also... why in $DEITY's name was the existing > > rcu_virt_note_context_switch() not actually sufficient? If we had that > > there, why did we need an additional explicit calls to rcu_all_qs() in > > the KVM loop, or the more

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 09:19:44PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 13:17 -0700, Paul E. McKenney wrote: > > As I understand it, they would like to have their guest run uninterrupted > > for extended times.  Because rcu_virt_note_context_switch() is a > > point-in-time

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 09:19:44PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 13:17 -0700, Paul E. McKenney wrote: > > As I understand it, they would like to have their guest run uninterrupted > > for extended times.  Because rcu_virt_note_context_switch() is a > > point-in-time

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Wed, 2018-07-11 at 13:17 -0700, Paul E. McKenney wrote: > As I understand it, they would like to have their guest run uninterrupted > for extended times.  Because rcu_virt_note_context_switch() is a > point-in-time quiescent state, it cannot tell RCU about the extended > quiescent state. > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Wed, 2018-07-11 at 13:17 -0700, Paul E. McKenney wrote: > As I understand it, they would like to have their guest run uninterrupted > for extended times.  Because rcu_virt_note_context_switch() is a > point-in-time quiescent state, it cannot tell RCU about the extended > quiescent state. > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 08:31:55PM +0200, Christian Borntraeger wrote: > So why is the rcu_virt_note_context_switch(smp_processor_id()); > in guest_enter_irqoff not good enough? > > This was actually supposed to tell rcu that being in the guest > is an extended quiescing period (like userspace).

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 08:31:55PM +0200, Christian Borntraeger wrote: > So why is the rcu_virt_note_context_switch(smp_processor_id()); > in guest_enter_irqoff not good enough? > > This was actually supposed to tell rcu that being in the guest > is an extended quiescing period (like userspace).

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Christian Borntraeger
So why is the rcu_virt_note_context_switch(smp_processor_id()); in guest_enter_irqoff not good enough? This was actually supposed to tell rcu that being in the guest is an extended quiescing period (like userspace). What has changed? On 07/11/2018 07:03 PM, David Woodhouse wrote: > On Wed,

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Christian Borntraeger
So why is the rcu_virt_note_context_switch(smp_processor_id()); in guest_enter_irqoff not good enough? This was actually supposed to tell rcu that being in the guest is an extended quiescing period (like userspace). What has changed? On 07/11/2018 07:03 PM, David Woodhouse wrote: > On Wed,

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > And here is an updated v4.15 patch with Marius's Reported-by and David's > > fix to my lost exclamation point. > > Thanks. Are you sending the original version of that

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 06:03:42PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > > And here is an updated v4.15 patch with Marius's Reported-by and David's > > fix to my lost exclamation point. > > Thanks. Are you sending the original version of that

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > And here is an updated v4.15 patch with Marius's Reported-by and David's > fix to my lost exclamation point. Thanks. Are you sending the original version of that to Linus? It'd be useful to have the commit ID so that we can watch for it

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Wed, 2018-07-11 at 09:49 -0700, Paul E. McKenney wrote: > And here is an updated v4.15 patch with Marius's Reported-by and David's > fix to my lost exclamation point. Thanks. Are you sending the original version of that to Linus? It'd be useful to have the commit ID so that we can watch for it

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 07:43:03AM -0700, Paul E. McKenney wrote: > On Wed, Jul 11, 2018 at 03:23:45PM +0100, David Woodhouse wrote: > > > > > > On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > > index f9c0ca2ccf0c..3350ece366ab 100644 > > > --- a/kernel/rcu/tree.c > > > +++

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 07:43:03AM -0700, Paul E. McKenney wrote: > On Wed, Jul 11, 2018 at 03:23:45PM +0100, David Woodhouse wrote: > > > > > > On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > > index f9c0ca2ccf0c..3350ece366ab 100644 > > > --- a/kernel/rcu/tree.c > > > +++

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 03:23:45PM +0100, David Woodhouse wrote: > > > On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > index f9c0ca2ccf0c..3350ece366ab 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -2839,6 +2839,15 @@ void rcu_check_callbacks(int user) > >  

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 03:23:45PM +0100, David Woodhouse wrote: > > > On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > index f9c0ca2ccf0c..3350ece366ab 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -2839,6 +2839,15 @@ void rcu_check_callbacks(int user) > >  

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > index f9c0ca2ccf0c..3350ece366ab 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2839,6 +2839,15 @@ void rcu_check_callbacks(int user) > rcu_bh_qs(); > } > rcu_preempt_check_callbacks();

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > index f9c0ca2ccf0c..3350ece366ab 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2839,6 +2839,15 @@ void rcu_check_callbacks(int user) > rcu_bh_qs(); > } > rcu_preempt_check_callbacks();

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 01:58:22PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 05:51 -0700, Paul E. McKenney wrote: > > > > Interesting.  (I am assuming that the guest is printing these messages, > > not the host, but please let me know if my assumption is incorrect.) > > No, this is

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 01:58:22PM +0100, David Woodhouse wrote: > On Wed, 2018-07-11 at 05:51 -0700, Paul E. McKenney wrote: > > > > Interesting.  (I am assuming that the guest is printing these messages, > > not the host, but please let me know if my assumption is incorrect.) > > No, this is

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Wed, 2018-07-11 at 05:51 -0700, Paul E. McKenney wrote: > > Interesting.  (I am assuming that the guest is printing these messages, > not the host, but please let me know if my assumption is incorrect.) No, this is all in the host. When the VMM (qemu, etc.) opens more files and has to expand

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Wed, 2018-07-11 at 05:51 -0700, Paul E. McKenney wrote: > > Interesting.  (I am assuming that the guest is printing these messages, > not the host, but please let me know if my assumption is incorrect.) No, this is all in the host. When the VMM (qemu, etc.) opens more files and has to expand

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 11:57:43AM +0100, David Woodhouse wrote: > On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > > > > And the earlier patch was against my -rcu tree, which won't be all that > > helpful for v4.15.  Please see below for a lightly tested backport to v4.15. > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread Paul E. McKenney
On Wed, Jul 11, 2018 at 11:57:43AM +0100, David Woodhouse wrote: > On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > > > > And the earlier patch was against my -rcu tree, which won't be all that > > helpful for v4.15.  Please see below for a lightly tested backport to v4.15. > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > And the earlier patch was against my -rcu tree, which won't be all that > helpful for v4.15.  Please see below for a lightly tested backport to v4.15. > > It should apply to all the releases of interest.  If other backports > are

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-11 Thread David Woodhouse
On Mon, 2018-07-09 at 15:08 -0700, Paul E. McKenney wrote: > > And the earlier patch was against my -rcu tree, which won't be all that > helpful for v4.15.  Please see below for a lightly tested backport to v4.15. > > It should apply to all the releases of interest.  If other backports > are

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-10 Thread Paul E. McKenney
On Tue, Jul 10, 2018 at 11:24:26AM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 01:42:48PM -0700, Paul E. McKenney wrote: > > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > > > > > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > > > > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-10 Thread Paul E. McKenney
On Tue, Jul 10, 2018 at 11:24:26AM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 01:42:48PM -0700, Paul E. McKenney wrote: > > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > > > > > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > > > > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-10 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 01:42:48PM -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > > > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-10 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 01:42:48PM -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > > > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 02:05:32PM -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 09:45:45PM +0100, David Woodhouse wrote: > > On Mon, 2018-07-09 at 13:42 -0700, Paul E. McKenney wrote: > > > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > >  > > > >  > > > > On

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 02:05:32PM -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 09:45:45PM +0100, David Woodhouse wrote: > > On Mon, 2018-07-09 at 13:42 -0700, Paul E. McKenney wrote: > > > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > >  > > > >  > > > > On

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 09:45:45PM +0100, David Woodhouse wrote: > On Mon, 2018-07-09 at 13:42 -0700, Paul E. McKenney wrote: > > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > >  > > >  > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > >  > > > > So here

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 09:45:45PM +0100, David Woodhouse wrote: > On Mon, 2018-07-09 at 13:42 -0700, Paul E. McKenney wrote: > > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > >  > > >  > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > >  > > > > So here

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread David Woodhouse
On Mon, 2018-07-09 at 13:42 -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > >  > >  > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > >  > > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > >  > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread David Woodhouse
On Mon, 2018-07-09 at 13:42 -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > >  > >  > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > >  > > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > >  > > >

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > > > 1.  A context switch will record the quiescent state and clear > >   

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 09:35:38PM +0100, David Woodhouse wrote: > > > On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > > > 1.  A context switch will record the quiescent state and clear > >   

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread David Woodhouse
On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > 1.  A context switch will record the quiescent state and clear > .rcu_urgent_qs.  (The failure to do the clearing in current -rcu > for

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread David Woodhouse
On Mon, 2018-07-09 at 13:34 -0700, Paul E. McKenney wrote: > > So here are the possible code paths when .rcu_urgent_qs is set to true: > > 1.  A context switch will record the quiescent state and clear > .rcu_urgent_qs.  (The failure to do the clearing in current -rcu > for

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 07:50:54PM +0100, David Woodhouse wrote: > > > On Mon, 2018-07-09 at 09:34 -0700, Paul E. McKenney wrote: > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index 51919985f6cf..33b0a1ec0536 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 07:50:54PM +0100, David Woodhouse wrote: > > > On Mon, 2018-07-09 at 09:34 -0700, Paul E. McKenney wrote: > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index 51919985f6cf..33b0a1ec0536 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread David Woodhouse
On Mon, 2018-07-09 at 09:34 -0700, Paul E. McKenney wrote: > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 51919985f6cf..33b0a1ec0536 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2496,6 +2496,10 @@ void rcu_check_callbacks(int user) >  { >  

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread David Woodhouse
On Mon, 2018-07-09 at 09:34 -0700, Paul E. McKenney wrote: > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 51919985f6cf..33b0a1ec0536 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2496,6 +2496,10 @@ void rcu_check_callbacks(int user) >  { >  

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 09:34:32AM -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 05:26:32PM +0200, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 07:29:32AM -0700, Paul E. McKenney wrote: > > > OK, so here are our options: > > > > > > 1.Add the RCU conditional to

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 09:34:32AM -0700, Paul E. McKenney wrote: > On Mon, Jul 09, 2018 at 05:26:32PM +0200, Peter Zijlstra wrote: > > On Mon, Jul 09, 2018 at 07:29:32AM -0700, Paul E. McKenney wrote: > > > OK, so here are our options: > > > > > > 1.Add the RCU conditional to

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 05:26:32PM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 07:29:32AM -0700, Paul E. McKenney wrote: > > OK, so here are our options: > > > > 1. Add the RCU conditional to need_resched(), as David suggests. > > Peter has concerns about overhead. > > > > 2.

Re: [RFC] Make need_resched() return true when rcu_urgent_qs requested

2018-07-09 Thread Paul E. McKenney
On Mon, Jul 09, 2018 at 05:26:32PM +0200, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 07:29:32AM -0700, Paul E. McKenney wrote: > > OK, so here are our options: > > > > 1. Add the RCU conditional to need_resched(), as David suggests. > > Peter has concerns about overhead. > > > > 2.

  1   2   >