All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir.fraser@eu.citrix.com>
To: "Wei, Gang" <gang.wei@intel.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH]CPUFREQ: Fix two racing issues during cpu hotplug
Date: Mon, 12 Apr 2010 07:09:39 +0100	[thread overview]
Message-ID: <C7E877B3.10596%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <E6467867A6B05E4FA831B7DF29925F5C40F16B24@shzsmsx502.ccr.corp.intel.com>

On 12/04/2010 05:45, "Wei, Gang" <gang.wei@intel.com> wrote:

> Move cpufreq_del_cpu() call into __cpu_disable to eliminate racing with dbs
> timer handler on policy & drv_data. Put it after local_irq_enable because
> xmalloc/xfree in cpufreq_del_cpu assert for this.

Can't you just kill_timer()? Adding extra code into a stop_machine context
is dangerous: e.g.,
xmalloc()->alloc_xenheap_pages()->memguard_unguard_range()->map_pages_to_xen
()->flush_area_all() results in deadlock as other cpus are spinning with
irqs disabled.

> Change access to cpufreq_statistic_lock from spin_lock to spin_lock_irqsave to
> avoid statistic data access racing between cpufreq_statistic_exit and dbs
> timer handler.

DBS timer handler is called in softirq context; cpu_freq_statistic_exit()
appears also always to be called from non-irq context. I don't see what
interrupt context you are protecting against.

 -- Keir

  reply	other threads:[~2010-04-12  6:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-12  4:45 [PATCH]CPUFREQ: Fix two racing issues during cpu hotplug Wei, Gang
2010-04-12  6:09 ` Keir Fraser [this message]
2010-04-12  6:54   ` Wei, Gang
2010-04-12  6:59     ` Keir Fraser
2010-04-12  7:40       ` Wei, Gang

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=C7E877B3.10596%keir.fraser@eu.citrix.com \
    --to=keir.fraser@eu.citrix.com \
    --cc=gang.wei@intel.com \
    --cc=xen-devel@lists.xensource.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.