mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Ashok Raj <ashok.raj@intel.com>
Cc: ashok.raj@intel.com, rjw@sisk.pl, linux-kernel@vger.kernel.org,
	davej@codemonkey.org.uk, mingo@elte.hu, linux@brodo.de,
	venkatesh.pallipadi@intel.com
Subject: Re: 2.6.14-git3: scheduling while atomic from cpufreq on Athlon64
Date: Sat, 5 Nov 2005 16:06:54 -0800	[thread overview]
Message-ID: <20051105160654.4148824b.akpm@osdl.org> (raw)
In-Reply-To: <20051105155407.A31099@unix-os.sc.intel.com>

Ashok Raj <ashok.raj@intel.com> wrote:
>
> On Sat, Nov 05, 2005 at 03:33:04PM -0800, Andrew Morton wrote:
> > Ashok Raj <ashok.raj@intel.com> wrote:
> > >
> > > Now we leave a trace in current->flags indicating current thread already 
> > >  is under cpucontrol lock held, so we dont attempt to do this another time.
> > > 
> > > ..
> > > +#define PF_HOTPLUG_CPU	0x01000000	/* Currently performing CPU hotplug */
> > >
> > 
> > It's still hacky - I mean, we could use this trick to avoid recursion onto
> > any lock in the kernel whenever we get ourselves into a mess.  We'd gain an
> > awful lot of PF_* flags.
> > 
> > So we should still view this as a temporary fix.
> > 
> > I don't think I've seen an analysis of the actual deadlock yet.  Are you
> > able to provide a stack trace of the offending callpath?
> 
> Hi Andrew,
> 
> we call the exact same functions in cpufreq during startup and in
> response to cpu hotplug events, to create or destroy
> sysfs entries /sys/devices/system/cpu/cpuX/cpufreq/*. cpufreq_add_dev().
> 
> problem is cpufreq_set_policy()  eventually ends up calling
> __cpufreq_driver_target() during the CPU_ONLINE, and CPU_DOWN_PREPARE
> that takes cpucontrol lock.
> 
> Since when we already in the cpu notifier callbacks, cpucontrol is already 
> held by the cpu_up() or the cpu_down() that caused the double lock.

I appreciate that, but was hoping to see the call graph for the deadlock,
with sysrq-t.

See, one fix might be to take the lock_cpu_hotplug() call out of
__cpufreq_driver_target() and move it higher up the cpufreq call tree. 
Into the lowest-level caller which is _above_ the function which the
hotplug code calls.

Like this:

	hotplug -> down() -> ... ->
	                            __cpufreq_driver_target()
	cpufreq -> down() -> ... -> 

and not like this:

	hotplug -> down() -> ... ->
	                            __cpufreq_driver_target() -> down()
	cpufreq -> ...           ->           


  reply	other threads:[~2005-11-06  0:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-31 15:06 Rafael J. Wysocki
2005-10-31 19:34 ` Andrew Morton
2005-10-31 19:45   ` Rafael J. Wysocki
2005-10-31 20:42     ` Ashok Raj
2005-11-01 19:07       ` Rafael J. Wysocki
2005-11-01 19:14         ` Ashok Raj
2005-11-01 19:44           ` Rafael J. Wysocki
2005-11-01 20:00             ` Ashok Raj
2005-11-01 19:49           ` Lee Revell
2005-11-04 22:30           ` Andrew Morton
2005-11-05  0:00             ` Ashok Raj
2005-11-05 23:19             ` Ashok Raj
2005-11-05 23:33               ` Andrew Morton
2005-11-05 23:54                 ` Ashok Raj
2005-11-06  0:06                   ` Andrew Morton [this message]
2005-11-06  4:32                   ` Keith Owens
2005-10-31 21:42   ` [patch] preempt-trace.patch Ingo Molnar
2005-11-01 19:08     ` Rafael J. Wysocki
2005-11-02  6:27   ` 2.6.14-git3: scheduling while atomic from cpufreq on Athlon64 Dave Jones

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=20051105160654.4148824b.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=ashok.raj@intel.com \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@brodo.de \
    --cc=mingo@elte.hu \
    --cc=rjw@sisk.pl \
    --cc=venkatesh.pallipadi@intel.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 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®