Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-07 Thread Chen Yu
On 2016年06月07日 17:13, Borislav Petkov wrote: On Tue, Jun 07, 2016 at 04:44:24PM +0800, Chen Yu wrote: I'm doing more test to verify this. I think it would be better if you looked into doing HLT as Brian suggested, instead of touching any memory during s/r. OK, I'll also test this solution.

Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-07 Thread Borislav Petkov
On Tue, Jun 07, 2016 at 04:44:24PM +0800, Chen Yu wrote: > I'm doing more test to verify this. I think it would be better if you looked into doing HLT as Brian suggested, instead of touching any memory during s/r. -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithar

Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-07 Thread Chen Yu
Hi Pavel, On 2016年06月07日 16:03, Pavel Machek wrote: On Mon 2016-06-06 22:19:09, Chen Yu wrote: Stress test from Varun Koyyalagunta reports that, the nonboot CPU would hang occasionally, when resuming from hibernation. Further investigation shows that, the precise phase when nonboot CPU hangs, i

Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-07 Thread Pavel Machek
On Mon 2016-06-06 22:19:09, Chen Yu wrote: > Stress test from Varun Koyyalagunta reports that, the > nonboot CPU would hang occasionally, when resuming from > hibernation. Further investigation shows that, the precise > phase when nonboot CPU hangs, is the time when the nonboot > CPU been woken up

Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-06 Thread H. Peter Anvin
On 06/06/16 09:40, Peter Zijlstra wrote: > On Mon, Jun 06, 2016 at 03:59:06PM +, Chen, Yu C wrote: > + if (hibernation_in_resume()) + mwait_ptr = empty_zero_page; + else + mwait_ptr = ¤t_thread_info()->flags; >>> >>> Why is this conditional? Is there any

Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-06 Thread Brian Gerst
On Mon, Jun 6, 2016 at 12:40 PM, Peter Zijlstra wrote: > On Mon, Jun 06, 2016 at 03:59:06PM +, Chen, Yu C wrote: > >> > > + if (hibernation_in_resume()) >> > > + mwait_ptr = empty_zero_page; >> > > + else >> > > + mwait_ptr = ¤t_thread_info()->flags; >> > >> > Why is this condi

Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-06 Thread Peter Zijlstra
On Mon, Jun 06, 2016 at 03:59:06PM +, Chen, Yu C wrote: > > > + if (hibernation_in_resume()) > > > + mwait_ptr = empty_zero_page; > > > + else > > > + mwait_ptr = ¤t_thread_info()->flags; > > > > Why is this conditional? Is there any case in which the zero page is not > > als

RE: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-06 Thread Chen, Yu C
Rafael J . Wysocki; Pavel > Machek; Brown, Len; Borislav Petkov; Zhu Guihua; Juergen Gross > Subject: Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when > resuming from hibernation > > On Mon, Jun 06, 2016 at 10:19:09PM +0800, Chen Yu wrote: > > @@ -1595,8 +1596,21 @@

Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-06 Thread Peter Zijlstra
On Mon, Jun 06, 2016 at 10:19:09PM +0800, Chen Yu wrote: > @@ -1595,8 +1596,21 @@ static inline void mwait_play_dead(void) >* This should be a memory location in a cache line which is >* unlikely to be touched by other processors. The actual >* content is immaterial as it i

[PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation

2016-06-06 Thread Chen Yu
Stress test from Varun Koyyalagunta reports that, the nonboot CPU would hang occasionally, when resuming from hibernation. Further investigation shows that, the precise phase when nonboot CPU hangs, is the time when the nonboot CPU been woken up incorrectly, and tries to monitor the mwait_ptr for t