Re: Suspend 2 merge: 16/51: Disable cache reaping during suspend.

Nigel Cunningham
2004-11-26T22:10:07Z

Hi.

On Fri, 2004-11-26 at 05:18, Pavel Machek wrote:
> Hi!
> > I have to admit to being a little unsure as to why this is needed, but
> > suspend's reliability is helped a lot by disabling cache reaping while
> > suspending. Perhaps one of the mm guys will be able to enlighten me
> > here. Might be SMP related.
>
> It would be good to understand it. Rather than slowing common code... why
> not down(&cache_chain_sem) in suspend2?

Didn't consider it, to be honest.

That said, if/when we start to use cpu hotplug for SMP, we'll deadlock
in cpuup_callback if we've got the sem.

> > {
> > struct list_head *walk;
> >
> > - if (down_trylock(&cache_chain_sem)) {
> > + if ((unlikely(test_suspend_state(SUSPEND_RUNNING))) ||
> > + (down_trylock(&cache_chain_sem)))
> > + {
> > /* Give up. Setup the next iteration. */
> > schedule_delayed_work(&__get_cpu_var(reap_work), REAPTIMEOUT_CPUC + smp_processor_id());
> > return;
> >
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at http://www.tux.org/lkml/
--
Nigel Cunningham
Pastoral Worker
Christian Reformed Church of Tuggeranong
PO Box 1004, Tuggeranong, ACT 2901

You see, at just the right time, when we were still powerless, Christ
died for the ungodly. -- Romans 5:6