Re: [PATCH] swap: remove the struct cpumask has_work

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

 



On 7/31/2014 7:51 AM, Michal Hocko wrote:
On Thu 31-07-14 11:30:19, Lai Jiangshan wrote:
It is suggested that cpumask_var_t and alloc_cpumask_var() should be used
instead of struct cpumask.  But I don't want to add this complicity nor
leave this unwelcome "static struct cpumask has_work;", so I just remove
it and use flush_work() to perform on all online drain_work.  flush_work()
performs very quickly on initialized but unused work item, thus we don't
need the struct cpumask has_work for performance.
Why? Just because there is general recommendation for using
cpumask_var_t rather than cpumask?

In this particular case cpumask shouldn't matter much as it is static.
Your code will work as well, but I do not see any strong reason to
change it just to get rid of cpumask which is not on stack.

The code uses for_each_cpu with a cpumask to avoid waking cpus that don't
need to do work.  This is important for the nohz_full type functionality,
power efficiency, etc.  So, nack for this change.

--
Chris Metcalf, Tilera Corp.
http://www.tilera.com

--
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]