mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Nathan Lynch <ntl@pobox.com>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	rusty@rustcorp.com.au
Subject: Re: CPU hotplug on i386
Date: Wed, 16 Mar 2005 21:51:58 +0100	[thread overview]
Message-ID: <20050316205158.GB2464@elf.ucw.cz> (raw)
In-Reply-To: <20050316184929.GA16469@otto>

Hi!

> On Wed, Mar 16, 2005 at 02:21:52PM +0100, Pavel Machek wrote:
> > +	int cpu, error;
> > +	cpus_clear(frozen_cpus);
> > +	printk("Freezing cpus...\n");
> > +	for_each_online_cpu(cpu) {
> > +		if (!cpu)
> > +			continue;
> > +		cpu_set(cpu, frozen_cpus);
> > +		error = cpu_down(cpu);
> > +		if (!error)
> > +			continue;
> > +		printk("Error taking cpu %d down: %d\n", cpu, error);
> > +		panic("Too many cpus");
> >  	}
> > -	printk("ok\n");
> > +	BUG_ON(smp_processor_id() != 0);
> >  }
> >  
> >  void enable_nonboot_cpus(void)
> >  {
> > -	printk("Restarting CPUs");
> > -	atomic_set(&freeze, 0);
> > -	while (atomic_read(&cpu_counter)) {
> > -		cpu_relax();
> > -		barrier();
> > +	int cpu, error;
> > +	printk("Thawing cpus...\n");
> > +	for_each_cpu_mask(cpu, frozen_cpus) {
> > +		if (!cpu)
> > +			continue;
> > +		error = cpu_up(cpu);
> > +		if (!error)
> > +			continue;
> > +		printk("Error taking cpu %d up: %d\n", cpu, error);
> > +		panic("Not enough cpus");
> >  	}
> 
> If you're going to depend on CONFIG_HOTPLUG_CPU for swsusp on smp, why
> not offline the non-boot cpus from userspace?  Same goes for onlining
> additional cpus during resume.

I'd like to stay in control. I may want to stop drivers first,
or something like that. Plus I need to do that during resume, too, when
userspace is not available, yet.
								Pavel
-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

  reply	other threads:[~2005-03-16 20:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16 13:21 Pavel Machek
2005-03-16 14:40 ` Rafael J. Wysocki
2005-03-17  0:40   ` Nigel Cunningham
2005-03-16 17:09 ` Nathan Lynch
2005-03-16 19:20   ` Zwane Mwaikambo
2005-03-16 23:51   ` Rafael J. Wysocki
2005-03-17  0:04     ` Pavel Machek
2005-03-17  0:16       ` Rafael J. Wysocki
2005-03-16 18:49 ` Nathan Lynch
2005-03-16 20:51   ` Pavel Machek [this message]
2005-03-18 11:45 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050316205158.GB2464@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntl@pobox.com \
    --cc=rjw@sisk.pl \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®