All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Mike Travis <travis@sgi.com>
Cc: Dieter Ries <clip2@gmx.de>,
	rusty@rustcorp.com.au, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: 2.6.29-rc1 does not boot
Date: Mon, 12 Jan 2009 19:55:46 +0100	[thread overview]
Message-ID: <20090112185546.GA15494@elte.hu> (raw)
In-Reply-To: <496B8382.9080808@sgi.com>


* Mike Travis <travis@sgi.com> wrote:

> Ingo Molnar wrote:
> > * Mike Travis <travis@sgi.com> wrote:
> ...
> >> Rusty - any ideas on how to avoid these clashes with the 
> >> get_online_cpus() call in work_on_cpu()?  Or something else to indicate 
> >> to lockdep that the circular lock dependency is ok (as you mentioned 
> >> before)?
> > 
> > I've queued up the revert below, please check the commit message whether 
> > you agree with the analysis.
> > 
> > Mike, could you also check any other patches where you add work_on_cpu() 
> > usage to make sure we dont have similar mishaps? work_on_cpu() seems 
> > completely unsuited for any sort of set_cpus_allowed() replacement ...
> > 
> > 	Ingo
> 
> Yes, I'll do that now.  With the resume feature also calling these functions,
> I'm even less comfortable with it.
> 
> Shall I resurrect the 2nd cpumask in the task struct from my original patches,
> (and one that akpm also suggested more than a year ago)?
> 
> Basically, it looks like this:
> 
> --- linux-2.6-for-ingo.orig/include/linux/sched.h       2009-01-11 10:43:19.000000000 -0800
> +++ linux-2.6-for-ingo/include/linux/sched.h    2009-01-12 09:45:02.871247038 -0800
> @@ -1132,6 +1132,7 @@ struct task_struct {
> 
>         unsigned int policy;
>         cpumask_t cpus_allowed;
> +       cpumask_t save_cpus_allowed;
> 
> --- linux-2.6-for-ingo.orig/arch/x86/kernel/microcode_core.c    2009-01-12 09:05:36.000000000 -0800
> +++ linux-2.6-for-ingo/arch/x86/kernel/microcode_core.c 2009-01-12 09:49:19.315276144 -0800
> @@ -110,11 +110,10 @@ EXPORT_SYMBOL_GPL(ucode_cpu_info);
>  #ifdef CONFIG_MICROCODE_OLD_INTERFACE
>  static int do_microcode_update(const void __user *buf, size_t size)
>  {
> -       cpumask_t old;
>         int error = 0;
>         int cpu;
> 
> -       old = current->cpus_allowed;
> +       cpumask_copy(&current->save_cpus_allowed, &current->cpus_allowed);
> 
>         for_each_online_cpu(cpu) {
>                 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
> @@ -122,7 +121,7 @@ static int do_microcode_update(const voi
>                 if (!uci->valid)
>                         continue;
> 
> -               set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
> +               set_cpus_allowed_ptr(current, cpumask_of(cpu));
>                 error = microcode_ops->request_microcode_user(cpu, buf, size);
>                 if (error < 0)
>                         goto out;
> @@ -130,7 +129,7 @@ static int do_microcode_update(const voi
>                         microcode_ops->apply_microcode(cpu);
>         }
>  out:
> -       set_cpus_allowed_ptr(current, &old);
> +       set_cpus_allowed_ptr(current, &current->save_cpus_allowed);
>         return error;
>  }
> 
> The primary concern is that there is only one temp, so I had also put in 
> a warning if it was already in use.  But the scope of where it's used is 
> very short-lived, so I don't know if a preempt_disable() is required, 
> but it seems the safe thing to do.

that's rather fragile. Fix work_on_cpu() instead? Why does it need to take 
the CPU-hotplug lock?

	Ingo

  reply	other threads:[~2009-01-12 18:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11 14:55 2.6.29-rc1 does not boot Dieter Ries
2009-01-11 15:19 ` Ingo Molnar
2009-01-11 15:30   ` Dieter Ries
2009-01-11 15:35     ` Ingo Molnar
2009-01-11 15:41       ` Dieter Ries
2009-01-11 18:50       ` Dieter Ries
2009-01-11 19:02         ` Mike Travis
2009-01-11 19:30           ` Dieter Ries
2009-01-12 10:00           ` Ingo Molnar
2009-01-12 17:53             ` Mike Travis
2009-01-12 18:55               ` Ingo Molnar [this message]
2009-01-15  0:54             ` Rusty Russell
2009-01-11 19:02         ` Ingo Molnar
2009-01-11 19:14           ` Mike Travis
2009-01-11 23:19             ` Mike Travis
2009-01-12  1:01             ` H. Peter Anvin
2009-01-12 11:22         ` Maciej Rutecki
2009-01-12 11:26           ` Ingo Molnar
2009-01-12 11:28             ` Maciej Rutecki
2009-01-12 12:10             ` Dieter Ries
2009-01-12 12:21               ` Ingo Molnar
2009-01-12 16:37                 ` Dieter Ries
2009-01-12 18:59                   ` Ingo Molnar
2009-01-13  4:45                     ` Michal Jaegermann
2009-01-12 17:22             ` 2.6.29-rc1 does not boot and fails to resume Rafael J. Wysocki
2009-01-14  1:16             ` 2.6.29-rc1 does not boot Rusty Russell
2009-01-14 11:30               ` Ingo Molnar
2009-01-14 12:47               ` Dieter Ries
2009-01-15 20:01         ` Mike Travis
2009-01-15 21:03           ` Dieter Ries
2009-01-15 21:48             ` Maciej Rutecki
2009-01-15 21:54               ` Mike Travis
2009-01-15 23:04                 ` Maciej Rutecki
2009-01-15 23:31                   ` Mike Travis
2009-01-15 21:54             ` Mike Travis
2009-01-15 23:02               ` Dieter Ries
2009-01-15 23:30                 ` Mike Travis

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=20090112185546.GA15494@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=clip2@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=travis@sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.