Re: suspend2 merge (was Re: [Suspend2-devel] Re: CFS and suspend2: hang in atomic copy)

Pavel Machek
2007-04-26T00:14:37Z

Hi!

> > > Why? Becuase there is no _room_ for inconsistency. There's nothing to be
> > > "inconsistent with", since any changes to memory (by things like DMA or
> > > other setup that happens while the suspend process is going on) is by
> > > _definition_ consistent with the resume image (becasue there is no
> > > separate image).
> >
> > Do you propose to keep DMAs running while suspending-to-RAM?
>
> What part of "suspend a chip" do you have trouble with?
>
> DMA obviously does *not* happen with a suspended device. There's no need
> to turn DMA even off - it just doesn't happen!

Ok, I guess I'll have nightmares of DMA controllers doing DMAs from
chips that are no longer there tonight.

> > > For example, the whole myth that "freeze" needs to shut off DMA is a total
> > > and utter *myth*. It needs nothing of the sort at all. Rather than shut
> > > off DMA and try to make the hardware be wevy wevy quiet while it's hunting
> > > wabbits, it's a lot easier to just do nothing at all on "freeze",
> >
> > No. Sorry, you are wrong here.
> >
> > Remember that during resume we run
> >
> > freeze()
> > copy old data into memory
> > thaw()
> >
> > Now, if the old kernel left DMAs running, it could be overwriting
> > the data we are copying in.
>
> The *thaw* needs to happen with devices quiescent.
>
> But that sure doesn't have anythign to do with the "snapshot()" path. In
> fact, you'll have rebooted the machine in between.

Only the fact that we are currently using same device call during
snapshot() and during restore(). We obviously could do _5_ device
calls

(suspend/resume/freeze/quiesce_disable_dma/thaw)

...but that looks like too many calls to me.

> So what does that have to do with "snapshotting"?

I'm not comfortable with memory I'm copying changing under my hands
because of some DMA. It just looks like asking for trouble. I _think_
we can get away with DMA running during snapshot, because driver may
not assume anything about the DMA result before it got completion
interrupt, but...

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html