Messages in this thread |  | | Date | Thu, 9 Apr 2015 19:42:18 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH v4 1/2] nohz: add tick_nohz_full_cpumask_or() and _andnot() APIs |
| |
On Thu, Apr 09, 2015 at 01:24:22PM -0400, Chris Metcalf wrote: > 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?
Yes, I think these are all clearer than previous attempts.
I'm not entirely sure which to pick though; I have a vague preference for add/remove over include/exclude and the top set reads better then the lower set but the lower set is more consistent in naming :/
But the important point is that these names all indicate you're going to change the mask passed as argument.
|  |