From: Thomas Gleixner <tglx@linutronix.de>
To: Yong Zhang <yong.zhang0@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Subject: Re: [PATCH -rt 4/5] workqueue: hotplug fix
Date: Wed, 19 Oct 2011 09:14:28 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1110190913320.3240@ionos> (raw)
In-Reply-To: <1318762607-2261-5-git-send-email-yong.zhang0@gmail.com>
On Sun, 16 Oct 2011, Yong Zhang wrote:
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -3195,30 +3195,34 @@ static int __devinit workqueue_cpu_up_callback(struct notifier_block *nfb,
> }
>
> /* some are called w/ irq disabled, don't disturb irq status */
> - spin_lock_irqsave(&gcwq->lock, flags);
>
> switch (action) {
> case CPU_UP_PREPARE:
> + spin_lock_irqsave(&gcwq->lock, flags);
> BUG_ON(gcwq->first_idle);
> gcwq->first_idle = new_worker;
> + spin_unlock_irqrestore(&gcwq->lock, flags);
> break;
>
> case CPU_UP_CANCELED:
> + spin_lock_irqsave(&gcwq->lock, flags);
> destroy_worker(gcwq->first_idle);
> gcwq->first_idle = NULL;
> + spin_unlock_irqrestore(&gcwq->lock, flags);
> break;
>
> case CPU_ONLINE:
> + spin_lock_irqsave(&gcwq->lock, flags);
> spin_unlock_irq(&gcwq->lock);
> kthread_bind(gcwq->first_idle->task, cpu);
> spin_lock_irq(&gcwq->lock);
> gcwq->flags |= GCWQ_MANAGE_WORKERS;
> start_worker(gcwq->first_idle);
> gcwq->first_idle = NULL;
> + spin_unlock_irqrestore(&gcwq->lock, flags);
> break;
> }
>
> - spin_unlock_irqrestore(&gcwq->lock, flags);
This part of the patch is pretty pointless.
> return notifier_from_errno(0);
> }
> @@ -3274,14 +3278,14 @@ static void flush_gcwq(struct global_cwq *gcwq)
>
> spin_unlock_irq(&gcwq->lock);
>
> - gcwq = get_gcwq(get_cpu());
> + gcwq = get_gcwq(get_cpu_light());
Right.
> spin_lock_irq(&gcwq->lock);
> list_for_each_entry_safe(work, nw, &non_affine_works, entry) {
> list_del_init(&work->entry);
> ___queue_work(get_work_cwq(work)->wq, gcwq, work);
> }
> spin_unlock_irq(&gcwq->lock);
> - put_cpu();
> + put_cpu_light();
> }
>
> static int __devinit workqueue_cpu_down_callback(struct notifier_block *nfb,
> --
> 1.7.1
>
>
next prev parent reply other threads:[~2011-10-19 7:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-16 10:56 [RFC] [PATCH -rt 0/5] patchset focusing on cpu hotplug Yong Zhang
2011-10-16 10:56 ` [PATCH -rt 1/5] hotplug: sync_unplug: No '\n' in task name Yong Zhang
2011-10-16 10:56 ` [PATCH -rt 2/5] hotplug: Call cpu_unplug_begin() a little early Yong Zhang
2011-10-16 10:56 ` [RFC] [PATCH -rt 3/5] printk: don't call printk_tick in printk_needs_cpu() Yong Zhang
2011-10-16 10:56 ` [PATCH -rt 4/5] workqueue: hotplug fix Yong Zhang
2011-10-19 7:14 ` Thomas Gleixner [this message]
2011-10-24 2:26 ` Yong Zhang
2011-10-24 9:25 ` Thomas Gleixner
2011-10-16 10:56 ` [RFC] [PATCH -rt 5/5] cpufreq: get rid of get_online_cpus()/put_online_cpus() Yong Zhang
2011-10-19 9:12 ` Thomas Gleixner
2011-10-24 2:44 ` Yong Zhang
2011-10-24 9:24 ` Thomas Gleixner
2011-10-24 11:30 ` Yong Zhang
2011-10-24 11:45 ` Thomas Gleixner
2011-10-24 11:56 ` Yong Zhang
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=alpine.LFD.2.02.1110190913320.3240@ionos \
--to=tglx@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=yong.zhang0@gmail.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