Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1181784 > unrolled thread

[PATCH] nohz: prevent tilegx network driver interrupts

Started byChris Metcalf <cmetcalf@ezchip.com>
First post2015-07-10 19:40 +0200
Last post2015-07-11 16:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] nohz: prevent tilegx network driver interrupts Chris Metcalf <cmetcalf@ezchip.com> - 2015-07-10 19:40 +0200
    Re: [PATCH] nohz: prevent tilegx network driver interrupts Frederic Weisbecker <fweisbec@gmail.com> - 2015-07-11 16:40 +0200

#1181784 — [PATCH] nohz: prevent tilegx network driver interrupts

FromChris Metcalf <cmetcalf@ezchip.com>
Date2015-07-10 19:40 +0200
Subject[PATCH] nohz: prevent tilegx network driver interrupts
Message-ID<pKKrf-t8-1@gated-at.bofh.it>
In nohz_full mode, by default distribute networking shim
interrupts across the housekeeping cores, not all the cores.

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
---
The alternate approaches to this might be:

1. "#define housekeeping_mask cpu_online_mask" in the non-nohz_full
   arm in <linux/tick.h>, then just unconditionally use
   "housekeeping_mask".

2. Provide an accessor that returns the cpumask to use for housekeeping
   chores and implement it in the obvious ways for both nohz_full
   and non-nohz_full.

The latter seems like arguably the most satisfying approach, but
the patch below is, if nothing else, suitable to push for 4.3
without any further API development work.

Frederic (or others), comments?

 drivers/net/ethernet/tile/tilegx.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index a3f7610002aa..7687c62e7d75 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -40,6 +40,7 @@
 #include <linux/tcp.h>
 #include <linux/net_tstamp.h>
 #include <linux/ptp_clock_kernel.h>
+#include <linux/tick.h>
 
 #include <asm/checksum.h>
 #include <asm/homecache.h>
@@ -2272,8 +2273,13 @@ static int __init tile_net_init_module(void)
 	for (i = 0; gxio_mpipe_link_enumerate_mac(i, name, mac) >= 0; i++)
 		tile_net_dev_init(name, mac);
 
-	if (!network_cpus_init())
+	if (!network_cpus_init()) {
+#ifdef CONFIG_NO_HZ_FULL
+		network_cpus_map = *housekeeping_mask;
+#else
 		network_cpus_map = *cpu_online_mask;
+#endif
+	}
 
 	return 0;
 }
-- 
2.1.2

--
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/

[toc] | [next] | [standalone]


#1182152

FromFrederic Weisbecker <fweisbec@gmail.com>
Date2015-07-11 16:40 +0200
Message-ID<pL46C-4hQ-3@gated-at.bofh.it>
In reply to#1181784
On Fri, Jul 10, 2015 at 03:05:02PM -0400, Chris Metcalf wrote:
> On 07/10/2015 02:24 PM, Frederic Weisbecker wrote:
> >Indeed we are doing more and more references on housekeeping_mask, so
> >we should probably think about an off-case.
> >
> >Now the nohz-full off-case should rather be cpu_possible_mask than
> >cpu_online_mask. housekeeping_mask doesn't take into account onlining
> >at all.
> 
> That suggests that in this case, we might want to default to
> something like "housekeeping_mask & cpu_online_mask",
> since you really don't want to send irqs to offline cores to
> process your packets :-)

In any case it must be up to the drivers to do that. Define
housekeeping_mask as a subset of the online mask complicates a lot
of things. It pushes hotplug complexity to the nohz code for no
reasons. It's up to the drivers and subsystems to handle that really.

> 
> The tilegx chips typically don't do cpu offlining anyway, since
> we've never really found a usecase, so whatever you boot with
> you always have available.  We do have support for a bare-metal
> mode which you can run on some of the cores, so you may start
> with fewer than cpu_possible actually running, but it will always
> be that same set of cores.

And that bare metal mode runs out of Linux?

Note that in nohz_full, The boot CPU can't be offline anyway.

> 
> So this does suggest that my original patch is wrong for that
> same reason.
> 
> >>2. Provide an accessor that returns the cpumask to use for housekeeping
> >>    chores and implement it in the obvious ways for both nohz_full
> >>    and non-nohz_full.
> >>
> >>The latter seems like arguably the most satisfying approach, but
> >>the patch below is, if nothing else, suitable to push for 4.3
> >>without any further API development work.
> >I don't know. 1) looks easier.
> 
> On reflection, the problem with (1) is that if you are in NO_HZ_FULL
> mode but !tick_nohz_full_enabled(), you want to fall back to just
> using cpu_possible_mask anyway.  So I think a simple accessor that
> returns an appropriate cpumask pointer is probably the best bet
> (along the lines of the existing is_housekeeping_cpu() accessor).

Ok!

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web