Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932956AbbDIRma (ORCPT ); Thu, 9 Apr 2015 13:42:30 -0400 Received: from casper.infradead.org ([85.118.1.10]:56559 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847AbbDIRm2 (ORCPT ); Thu, 9 Apr 2015 13:42:28 -0400 Date: Thu, 9 Apr 2015 19:42:18 +0200 From: Peter Zijlstra To: Chris Metcalf Cc: Frederic Weisbecker , "Paul E. McKenney" , "Rafael J. Wysocki" , Martin Schwidefsky , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 1/2] nohz: add tick_nohz_full_cpumask_or() and _andnot() APIs Message-ID: <20150409174218.GT21418@twins.programming.kicks-ass.net> References: <20150409082921.GP27490@worktop.programming.kicks-ass.net> <1428598839-24296-1-git-send-email-cmetcalf@ezchip.com> <20150409170733.GR21418@twins.programming.kicks-ass.net> <5526B5C6.6010202@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5526B5C6.6010202@ezchip.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1717 Lines: 46 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/