Re: [PATCH] mm: Introduce dedicated WQ_MEM_RECLAIM workqueue to do lru_add_drain_all

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 02, 2016 at 03:48:51PM +0800, Wang Sheng-Hui wrote:
> +static int __init lru_init(void)
> +{
> +	lru_add_drain_wq = alloc_workqueue("lru-add-drain",
> +		WQ_MEM_RECLAIM | WQ_UNBOUND, 0);

Why is it unbound?

> +	if (WARN(!lru_add_drain_wq,
> +		"Failed to create workqueue lru_add_drain_wq"))
> +		return -ENOMEM;

I don't think we need an explicit warn here.  Doesn't error return
from an init function trigger boot failure anyway?

> +	return 0;
> +}
> +early_initcall(lru_init);
> +
>  void lru_add_drain_all(void)
>  {
>  	static DEFINE_MUTEX(lock);
>  	static struct cpumask has_work;
>  	int cpu;
>  
> +	struct workqueue_struct *lru_wq = lru_add_drain_wq ?: system_wq;
> +
> +	WARN_ONCE(!lru_add_drain_wq,
> +		"Use system_wq to do lru_add_drain_all()");

Ditto.  The system is crashing for sure.  What's the point of this
warning?

Thanks.

-- 
tejun

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]