lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 19 Oct 2011 09:14:28 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Yong Zhang <yong.zhang0@...il.com>
cc:	linux-kernel@...r.kernel.org, linux-rt-users@...r.kernel.org
Subject: Re: [PATCH -rt 4/5] workqueue: hotplug fix

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
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ