Re: [PATCH v4 1/2] nohz: add tick_nohz_full_cpumask_or() and _andnot() APIs

From: Chris Metcalf
Date: Thu Apr 09 2015 - 13:24:39 EST


On 04/09/2015 01:07 PM, Peter Zijlstra wrote:
On Thu, Apr 09, 2015 at 01:00:38PM -0400, Chris Metcalf wrote:
+static inline void tick_nohz_full_cpumask_or(struct cpumask *mask)
This still reads as if you're doing: nohz_full_mask |= mask.

I think the suggestion done by Frederic is the right one, reverse the
lot, have:

isolcpu_map_or(nohz_full_map) := isolcpus_map |= nohz_full_map

Or just completely give up and just write readable code under an #ifdef.

OK, so let's go with v5 (in the other thread) plus comments on init ordering, then.
I'll repost that shortly.

However, I'd still appreciate guidance on the naming, since I do
have a patch outstanding to fiddle with cpumasks for nohz_full
(in the other case, for the tilegx network driver irq mask).

So here's the obvious readable code snippet approach:

#ifdef CONFIG_NO_HZ_FULL
cpumask_or(some_random_map, some_random_map, tick_nohz_full_map);
#endif

Some possible names so we can macroize them to no-ops:

exclude_nohz_full_cpus_from(some_random_map);
or
remove_nohz_full_cpus_from(some_random_map);

include_nohz_full_cpus_in(some_random_map);
or
add_nohz_full_cpus_to(some_random_map);

or perhaps with better namespace prefixes, but more confusing to read:

tick_nohz_full_exclude_cpus_from(some_random_map);
or
tick_nohz_full_remove_cpus_from(some_random_map);

tick_nohz_full_include_cpus_in(some_random_map);
or
tick_nohz_full_add_cpus_to(some_random_map);

Any of these sound good? Any other ideas?

--
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com

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