[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53DBCB55.3050302@tilera.com>
Date: Fri, 1 Aug 2014 13:16:05 -0400
From: Chris Metcalf <cmetcalf@...era.com>
To: Lai Jiangshan <laijs@...fujitsu.com>
CC: Michal Hocko <mhocko@...e.cz>, <linux-kernel@...r.kernel.org>,
<akpm@...ux-foundation.org>, Mel Gorman <mgorman@...e.de>,
Tejun Heo <tj@...nel.org>, Christoph Lameter <cl@...two.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Rik van Riel <riel@...hat.com>,
Jianyu Zhan <nasa4836@...il.com>,
Johannes Weiner <hannes@...xchg.org>,
Khalid Aziz <khalid.aziz@...cle.com>, <linux-mm@...ck.org>,
Gilad Ben-Yossef <gilad@...yossef.com>
Subject: Re: [PATCH] swap: remove the struct cpumask has_work
On 7/31/2014 9:39 PM, Lai Jiangshan wrote:
> On 08/01/2014 12:09 AM, Chris Metcalf wrote:
>> 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.
>>
> flush_work() on initialized but unused work item just disables irq and
> fetches work->data to test and restores irq and return.
>
> the struct cpumask has_work is just premature optimization.
Yes, I see your point. I was mistakenly thinking that your patch resulted
in calling schedule_work() on all the online cpus.
Given that, I think your suggestion is reasonable, though like Michal,
I'm not sure it necessarily rises to the level of it being worth changing the
code at this point. Regardless, I withdraw my nack, and you can add my
Reviewed-by: Chris Metcalf <cmetcalf@...era.com> if the change is taken.
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
--
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