public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: travis@sgi.com, mingo@redhat.com, davej@redhat.com,
	cpufreq@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] work_on_cpu: Use our own workqueue.
Date: Wed, 4 Feb 2009 07:36:36 -0800	[thread overview]
Message-ID: <20090204073636.30f15339.akpm@linux-foundation.org> (raw)
In-Reply-To: <200902042111.35543.rusty@rustcorp.com.au>

On Wed, 4 Feb 2009 21:11:35 +1030 Rusty Russell <rusty@rustcorp.com.au> wrote:

> On Wednesday 04 February 2009 13:31:11 Andrew Morton wrote:
> > On Wed, 4 Feb 2009 13:14:31 +1030 Rusty Russell <rusty@rustcorp.com.au> wrote:
> > > I think you're right though: smp_call_function_single (or neat wrappers)
> > > where possible, work_on_cpu which can fail for the others, and we'll just
> > > have to plumb in the error returns.
> > 
> > I bet a lot of those can use plain old schedule_work_on().
> 
> Which is where work_on_cpu started: a little wrapper around schedule_work_on.
> 
> We're going in circles, no?

No, we've made some progress.  We have a better understanding of what
the restrictions, shortcomings and traps are in this stuff.  We've
learned (surprise!) that a one-size-fits-all big hammer wasn't such a
great idea.

Proposed schedule_work_on() rule: either the flush_work() caller or the
callback should not hold any explicit or implicit sleeping locks.

Quick scan:

arch/x86/kernel/reboot.c:native_machine_shutdown()

  I think this can/should continue to use set_cpus_allowed(). 
  Although it could be converted to schedule_work_on(), as long as the
  scheduler is still working properly at this time.

x86 microcode:

  This code is just nuts.  What's the point in pinning itself to a
  CPU for the act of loading the microcode into main memory?  It's only
  the loading of the microcode which should care about which CPU
  executes the code.  ie: apply_microcode().

  The code needs some laundering, switch to schedule_work_on(). 
  Ensure that the callback functions don't take microcode_mutex.

arch/x86/kernel/apm_32.c:

  It's a kernel thread.  Add kthread_bind() to caller, done.

arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c:

  Switch to rdmsr_on_cpu() and friends

arch/x86/kernel/cpu/cpufreq/powernow-k8.c

  Could get similar treatment (needs new cpuid_on_cpu()?).  Looks
  like schedule_work_on() would be OK to use as well.

arch/x86/kernel/cpu/cpufreq/speedstep-ich.c

  Use rdmsr_on_cpu().

arch/blackfin/kernel/ipipe.c

  Use kthread_bind()

arch/arm/mach-integrator/cpu.c

  Not sure.

arch/sparc/kernel/us3_cpufreq.c

  Use smp_call_function_single().  Write sparc64_get_clock_tick_on_cpu().

arch/sparc/kernel/us2e_cpufreq.c

  Ditto

arch/sparc/kernel/sysfs.c

  If sun4v_mmustat_info() can be called from interrupt, use
  smp_call_function_single().  Otherwise schedule_work_on().

arch/powerpc/platforms/pseries/rtasd.c

  Ditto

arch/powerpc/kernel/smp.c

  Ditto

arch/powerpc/kernel/sysfs.c

  Blah.  Looks like schedule_work_on() will be OK.

arch/mips/kernel/traps.c

  NFI what this does

arch/sh/kernel/cpufreq.c

  schedule_work_on()

arch/ia64/sn/kernel/sn2/sn_hwperf.c

  schedule_work_on()

arch/ia64/kernel/salinfo.c:

  schedule_work_on()

arch/ia64/kernel/topology.c:

  schedule_work_on()

arch/ia64/kernel/cpufreq/acpi-cpufreq.c:

  schedule_work_on()

mm/pdflush.c:

  wtf what the heck is all that stuff and who added it?  weird.

  Leave it alone I guess.  Can admins manually move kernel threads to
  other CPUs?

mm/vmscan.c:

  switch to kthread_bind()

net/sunrpc/svc.c:

  switch to kthread_bind()

kernel/kmod.c:

  switch to kthreads, write then switch to kthread_bind_mask().

drivers/firmware/dcdbas.c:

  smp_call_function_single()

drivers/misc/sgi-xp/xpc_main.c:

  kthread_bind()

drivers/acpi/processor_throttling.c:

  already done



  reply	other threads:[~2009-02-04 15:38 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-16 19:11 [PATCH 0/3] cpu freq: fix problems with work_on_cpu usage in acpi-cpufreq Mike Travis
2009-01-16 19:11 ` [PATCH 1/3] work_on_cpu: dont try to get_online_cpus() in work_on_cpu Mike Travis
2009-01-16 19:11 ` [PATCH 2/3] work_on_cpu: Use our own workqueue Mike Travis
2009-01-24  8:15   ` Andrew Morton
     [not found]     ` <200901261711.43943.rusty@rustcorp.com.au>
2009-01-26  7:01       ` Andrew Morton
2009-01-26 17:16         ` Ingo Molnar
2009-01-26 18:35           ` Andrew Morton
2009-01-26 20:20             ` Ingo Molnar
2009-01-26 20:43               ` Mike Travis
2009-01-26 21:00               ` Andrew Morton
2009-01-26 21:27                 ` Ingo Molnar
2009-01-26 21:35                   ` Andrew Morton
2009-01-26 21:45                     ` Ingo Molnar
2009-01-26 22:01                       ` Andrew Morton
2009-01-26 22:05                         ` Ingo Molnar
2009-01-26 22:16                           ` Andrew Morton
2009-01-26 22:20                             ` Ingo Molnar
2009-01-26 22:50                               ` Andrew Morton
2009-01-26 22:59                                 ` Ingo Molnar
2009-01-26 23:42                                   ` Andrew Morton
2009-01-26 23:53                                     ` Ingo Molnar
2009-01-27  0:42                                       ` Andrew Morton
2009-01-26 22:31                             ` Oleg Nesterov
2009-01-26 22:15                         ` Oleg Nesterov
2009-01-26 22:24                           ` Ingo Molnar
2009-01-26 22:37                             ` Oleg Nesterov
2009-01-26 22:42                               ` Ingo Molnar
2009-01-26 21:50                     ` Oleg Nesterov
2009-01-26 22:17                       ` Ingo Molnar
2009-01-26 23:01                         ` Mike Travis
2009-01-27  0:09                           ` Oleg Nesterov
2009-01-27  7:15                         ` Rusty Russell
2009-01-27 17:55                           ` Oleg Nesterov
2009-01-27  7:05         ` Rusty Russell
2009-01-27  7:25           ` Andrew Morton
2009-01-27 15:28             ` Ingo Molnar
2009-01-27 16:51               ` Andrew Morton
2009-01-28 13:02             ` Rusty Russell
2009-01-28 17:19               ` Mike Travis
2009-01-28 17:32                 ` Mike Travis
2009-01-29 10:39                   ` Rusty Russell
2009-01-28 19:44               ` Andrew Morton
2009-01-29  1:43                 ` Rusty Russell
2009-01-29  2:12                   ` Andrew Morton
2009-01-30  6:03                     ` Rusty Russell
2009-01-30  6:30                       ` Andrew Morton
2009-01-30 13:49                         ` Ingo Molnar
2009-01-30 17:08                           ` Andrew Morton
2009-01-30 21:59                         ` Rusty Russell
2009-01-30 22:17                           ` Andrew Morton
2009-02-02 12:35                             ` Rusty Russell
2009-02-03  4:06                               ` Andrew Morton
2009-02-04  2:44                                 ` Rusty Russell
2009-02-04  3:01                                   ` Andrew Morton
2009-02-04 10:41                                     ` Rusty Russell
2009-02-04 15:36                                       ` Andrew Morton [this message]
2009-02-04 21:35                                         ` Ingo Molnar
2009-02-04 21:48                                           ` Andrew Morton
2009-02-04 21:54                                             ` Ingo Molnar
2009-02-04 23:45                                             ` Rusty Russell
2009-02-05 12:19                                             ` Pavel Machek
2009-02-05 17:44                                             ` Dmitry Adamushko
2009-02-10  8:54                                         ` Rusty Russell
2009-02-10  9:35                                           ` Andrew Morton
2009-02-11  0:32                                             ` Rusty Russell
2009-01-16 19:11 ` [PATCH 3/3] cpufreq: use work_on_cpu in acpi-cpufreq.c for drv_read and drv_write Mike Travis
2009-01-16 23:38 ` [PATCH 0/3] cpu freq: fix problems with work_on_cpu usage in acpi-cpufreq [PULL request] Mike Travis
2009-01-17 22:08   ` Ingo Molnar
2009-01-19 17:11     ` Mike Travis
2009-01-19 17:26       ` Ingo Molnar

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=20090204073636.30f15339.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cpufreq@vger.kernel.org \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox