On Mon, Jun 6, 2016 at 12:40 PM, Peter Zijlstra <[email protected]> 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 = ¤t_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.
I would think the safest thing to do during resume from hibernation is to use hlt instead of mwait, so there is no dependency on any memory address. It doesn't need the power management features of mwait either because the CPU will be reset soon after the restored kernel resumes. -- Brian Gerst

