public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Chris Metcalf <cmetcalf@ezchip.com>
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 1/2] nohz: add tick_nohz_full_add_cpus_to() and _remove_cpus_from() APIs
Date: Tue, 14 Apr 2015 17:34:58 +0200	[thread overview]
Message-ID: <20150414153457.GC1781@lerouge> (raw)
In-Reply-To: <552C6410.1090105@ezchip.com>

On Mon, Apr 13, 2015 at 08:49:20PM -0400, Chris Metcalf wrote:
> On 4/13/2015 8:33 PM, Frederic Weisbecker wrote:
> >On Fri, Apr 10, 2015 at 04:53:51PM -0400, Chris Metcalf wrote:
> >>The "removes_cpus_from" API is useful, for example, to modify a cpumask
> >>to avoid the nohz cores so that interrupts aren't sent to them.
> >>
> >>Likewise the "add_cpus_to" API is useful to modify a cpumask indicating
> >>some special nohz-type functionality so that the nohz cores are
> >>automatically added to that set.
> >>
> >>Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
> >>---
> >>[...]
> >>
> >>diff --git a/include/linux/tick.h b/include/linux/tick.h
> >>index 9c085dc12ae9..8d1754c0f694 100644
> >>--- a/include/linux/tick.h
> >>+++ b/include/linux/tick.h
> >>@@ -186,6 +186,18 @@ static inline bool tick_nohz_full_cpu(int cpu)
> >>  	return cpumask_test_cpu(cpu, tick_nohz_full_mask);
> >>  }
> >>+static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask)
> >>+{
> >>+	if (tick_nohz_full_enabled())
> >>+		cpumask_or(mask, mask, tick_nohz_full_mask);
> >>+}
> >>+
> >>+static inline void tick_nohz_full_remove_cpus_from(struct cpumask *mask)
> >>+{
> >>+	if (tick_nohz_full_enabled())
> >>+		cpumask_andnot(mask, mask, tick_nohz_full_mask);
> >I would prefer that you don't introduce new APIs if they aren't used in your
> >patchset. It seems that's the case for tick_nohz_full_remove_cpus_from().
> 
> Yes, it's used in a tile-tree patch to remove nohz_full cpus from the set that
> take interrupts from the tilegx network driver.
> 
> I can certainly make this patchset have just the _add_cpus_to() variant,
> and the other patchset have just the _remove_cpus_from() variant.
> It seemed to make sense to include them together as a matched set,
> but doing it the way you suggest makes an equal if different amount of sense.
> 
> >Also we have housekeeping_affine() that affines a task to CPUs outside the
> >range of nohz full. In case you still need tick_nohz_full_remove_cpus_from()
> >in a further patchset, housekeeping_affine_cpumask() would extend the existing
> >naming.
> 
> I like housekeeping_affine(), but it overwrites the affinity mask of
> the task.  So I would expect housekeeping_affine_mask() to overwrite
> the specified argument cpumask, which it doesn't in my definition.
> 
> I don't know that I can think of a good name in the "housekeeping_xxx"
> namespace that feels better than the one I proposed.  In context of the
> proposed client of the API so far, it's:
> 
>        if (!network_cpus_init()) {
>                network_cpus_map = *cpu_online_mask;
> tick_nohz_full_remove_cpus_from(&network_cpus_map);
>        }
> 
> If housekeeping_mask were defined for non-nohz_full I could just use
> it unconditionally here.  Alternately I could just put in an #ifdef for
> CONFIG_NO_HZ_FULL and either use cpu_only_mask or housekeeping_mask
> to initialize network_cpus_map, which dodges the bullet of creating
> an acceptable API name here for the moment.
> 
> Frederic, what's your thought/preference?

Right, the more I look into this whole, the more I think we should perhaps
make tick_nohz_full_cpumask a read-only wide visible cpumask like we do
for the cpumask in kernel/cpu.c defined as "const struct cpumask *const tick_nohz_full_mask"
and do the cpumask operations with it.

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

  reply	other threads:[~2015-04-14 15:35 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 16:24 [PATCH 1/2] nohz: add tick_nohz_full_set_cpus() API cmetcalf
2015-04-03 16:24 ` [PATCH 2/2] nohz: make nohz_full imply isolcpus cmetcalf
2015-04-03 17:42   ` Frederic Weisbecker
2015-04-03 19:20     ` Chris Metcalf
2015-04-04 14:10       ` Rik van Riel
2015-04-04 17:09         ` Chris Metcalf
2015-04-05  5:05           ` Ingo Molnar
2015-04-06 17:15             ` Chris Metcalf
2015-04-06 18:16               ` [PATCH v2 1/2] nohz: add tick_nohz_full_clear_cpus() and _set_cpus() APIs cmetcalf
2015-04-06 18:16                 ` [PATCH v2 2/2] nohz: make nohz_full imply isolcpus cmetcalf
2015-04-07 22:29                   ` Frederic Weisbecker
2015-04-08  9:41                   ` Peter Zijlstra
2015-04-08 14:04                     ` Chris Metcalf
2015-04-08 14:26                       ` Peter Zijlstra
2015-04-08 15:21                         ` Chris Metcalf
2015-04-08 17:24                           ` Frederic Weisbecker
2015-04-08 19:20                             ` [PATCH v3 1/2] nohz: add tick_nohz_full_clear_cpus() and _set_cpus() APIs cmetcalf
2015-04-08 19:20                               ` [PATCH v3 2/2] nohz: set isolcpus when nohz_full is set cmetcalf
2015-04-08 17:27                           ` [PATCH v2 2/2] nohz: make nohz_full imply isolcpus Peter Zijlstra
2015-04-08 18:12                             ` Chris Metcalf
2015-04-09  8:29                               ` Peter Zijlstra
2015-04-09 12:02                                 ` Chris Metcalf
2015-04-09 12:45                                   ` Frederic Weisbecker
2015-04-09 16:59                                     ` [PATCH v5] nohz: set isolcpus when nohz_full is set Chris Metcalf
2015-04-09 17:12                                       ` Peter Zijlstra
2015-04-10  1:05                                         ` Mike Galbraith
2015-04-10 15:33                                           ` Chris Metcalf
2015-04-10 15:57                                             ` Mike Galbraith
2015-04-09 17:00                                 ` [PATCH v4 1/2] nohz: add tick_nohz_full_cpumask_or() and _andnot() APIs Chris Metcalf
2015-04-09 17:00                                   ` [PATCH v4 2/2] nohz: set isolcpus when nohz_full is set Chris Metcalf
2015-04-09 17:07                                   ` [PATCH v4 1/2] nohz: add tick_nohz_full_cpumask_or() and _andnot() APIs Peter Zijlstra
2015-04-09 17:24                                     ` Chris Metcalf
2015-04-09 17:42                                       ` Peter Zijlstra
2015-04-09 18:01                                         ` [PATCH v6 1/2] nohz: add tick_nohz_full_add_cpus_to() and _remove_cpus_from() APIs Chris Metcalf
2015-04-09 18:01                                           ` [PATCH v6 2/2] nohz: set isolcpus when nohz_full is set Chris Metcalf
2015-04-10  1:37                                             ` Frederic Weisbecker
2015-04-10 20:53                                               ` [PATCH v7 1/2] nohz: add tick_nohz_full_add_cpus_to() and _remove_cpus_from() APIs Chris Metcalf
2015-04-10 20:53                                                 ` [PATCH v7 2/2] nohz: set isolcpus when nohz_full is set Chris Metcalf
2015-04-14  0:37                                                   ` Frederic Weisbecker
2015-04-14 15:17                                                     ` [PATCH v8 1/2] nohz: add tick_nohz_full_add_cpus_to() API Chris Metcalf
2015-04-14 15:17                                                       ` [PATCH v8 2/2] nohz: set isolcpus when nohz_full is set Chris Metcalf
2015-04-14 15:26                                                         ` Frederic Weisbecker
2015-04-14 16:45                                                           ` Peter Zijlstra
2015-04-14  0:33                                                 ` [PATCH v7 1/2] nohz: add tick_nohz_full_add_cpus_to() and _remove_cpus_from() APIs Frederic Weisbecker
2015-04-14  0:49                                                   ` Chris Metcalf
2015-04-14 15:34                                                     ` Frederic Weisbecker [this message]
2015-04-10  1:34                                           ` [PATCH v6 " Frederic Weisbecker
2015-04-10 15:31                                             ` Chris Metcalf
2015-04-06 18:29                 ` [PATCH v2 1/2] nohz: add tick_nohz_full_clear_cpus() and _set_cpus() APIs Frederic Weisbecker
2015-04-06 19:09                   ` Chris Metcalf
2015-04-07  9:33                     ` Ingo Molnar
2015-04-03 18:08   ` [PATCH 2/2] nohz: make nohz_full imply isolcpus Mike Galbraith
2015-04-03 19:21     ` Chris Metcalf
2015-04-04  2:03       ` Mike Galbraith
2015-04-04  3:43         ` Mike Galbraith
2015-04-06 19:28           ` Rik van Riel
2015-04-07  3:10             ` Mike Galbraith
  -- strict thread matches above, loose matches on Subject: below --
2015-05-06 16:04 [GIT PULL] nohz: A few improvements v4 Frederic Weisbecker
2015-05-06 16:04 ` [PATCH 1/4] context_tracking: Protect against recursion Frederic Weisbecker
2015-05-07  9:58   ` Ingo Molnar
2015-05-07 11:53     ` Frederic Weisbecker
2015-05-07 11:31   ` [tip:timers/nohz] " tip-bot for Frederic Weisbecker
2015-05-06 16:04 ` [PATCH 2/4] context_tracking: Inherit TIF_NOHZ through forks instead of context switches Frederic Weisbecker
2015-05-07 11:31   ` [tip:timers/nohz] " tip-bot for Frederic Weisbecker
2015-05-06 16:04 ` [PATCH 3/4] nohz: Add tick_nohz_full_add_cpus_to() API Frederic Weisbecker
2015-05-07 11:31   ` [tip:timers/nohz] " tip-bot for Chris Metcalf
2015-05-06 16:04 ` [PATCH 4/4] nohz: Set isolcpus when nohz_full is set Frederic Weisbecker
2015-05-07 11:32   ` [tip:timers/nohz] " tip-bot for Chris Metcalf
2015-05-16 19:39   ` [PATCH 4/4] " Sasha Levin
2015-05-17  5:30     ` Mike Galbraith
2015-05-18  2:17       ` Rik van Riel
2015-05-18  3:29         ` Mike Galbraith
2015-05-18 14:07           ` Rik van Riel
2015-05-18 14:22             ` Mike Galbraith
2015-05-18 14:52               ` Rik van Riel
2015-05-19  2:30                 ` Mike Galbraith
2015-06-12 19:12                   ` Rik van Riel
2015-05-20 20:38       ` Afzal Mohammed
2015-05-20 21:00         ` Paul E. McKenney
2015-05-21 12:12           ` Afzal Mohammed
2015-05-21 12:57             ` Paul E. McKenney
2015-05-21 13:06               ` Frederic Weisbecker
2015-05-21 13:27                 ` Paul E. McKenney
2015-05-21 13:29                 ` Afzal Mohammed
2015-05-21 14:14                   ` Paul E. McKenney
2015-05-21 14:46                     ` Frederic Weisbecker
2015-05-21 18:59                 ` Mike Galbraith
2015-05-22 14:39                   ` Frederic Weisbecker
2015-05-22 15:20                     ` Mike Galbraith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150414153457.GC1781@lerouge \
    --to=fweisbec@gmail.com \
    --cc=cmetcalf@ezchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox