lkml.org 
[lkml]   [2016]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation
From
Date
On 06/06/16 09:40, Peter Zijlstra wrote:
> On Mon, Jun 06, 2016 at 03:59:06PM +0000, Chen, Yu C wrote:
>
>>>> + if (hibernation_in_resume())
>>>> + mwait_ptr = empty_zero_page;
>>>> + else
>>>> + mwait_ptr = &current_thread_info()->flags;
>>>
>>> Why is this conditional? Is there any case in which the zero page is not also
>>> correct?
>> I'm thinking of avoid unnecessary wakeup for normal CPU offline, for example,
>> if one driver uses the zero page and access it.
>
> Writing to the zero page would be a major fail.
>

One implementation of MWAIT is for the waiting processor to claim the
line in an exclusive state, which would be highly undesirable for the
zero page. I don't actually know if this is done by any real
implementation, however.

Either way, the problem at hand seems limited to post-hibernation, as
for regular CPU offline the page tables will be fully populated, so it
seems like it should not be an issue.

-hpa

\
 
 \ /
  Last update: 2016-06-06 23:21    [W:0.062 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site