linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] remove extended cede offline mode and bogus topology update code
@ 2020-06-12  5:12 Nathan Lynch
  2020-06-12  5:12 ` [PATCH 01/18] powerpc/pseries: remove cede offline state for CPUs Nathan Lynch
                   ` (18 more replies)
  0 siblings, 19 replies; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Two major parts to this series:

1. Removal of the extended cede offline mode for CPUs as well as the
   partition suspend code which accommodates it by temporarily
   onlining all CPUs prior to suspending the LPAR. This solves some
   accounting problems, simplifies the pseries CPU hotplug code, and
   greatly uncomplicates the existing partition suspend code, easing
   a much-needed transition to the Linux suspend framework. The two
   patches which make up this part have been posted before:

   https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=180718

   and they are simply incorporated unchanged into the larger series
   here, with Gautham's Reviewed-by added to patch #1.

2. Removal of the long-disabled "topology update" code, most of which
   resides in mm/numa.c, but there are pieces in pseries and rtasd to
   excise as well. This code was an attempt to honor changes in a
   partition's NUMA properties arising from resource reassignments
   which occur as part of a migration, VPHN change, or a Dynamic
   Platform Optimizer operation. Its main technique is to remove and
   re-add affected processors and LMBs and hope in vain that the
   changes in cpu-node and physaddr-node relationships aren't
   disruptive. We want to provide user space with some indication that
   Linux's logical NUMA representation has become out of sync with the
   platform's assignments, but we need to get this unusable stuff out
   of the way before this code can sustain new features.

Nathan Lynch (18):
  powerpc/pseries: remove cede offline state for CPUs
  powerpc/rtas: don't online CPUs for partition suspend
  powerpc/numa: remove ability to enable topology updates
  powerpc/numa: remove unreachable topology update code
  powerpc/numa: make vphn_enabled, prrn_enabled flags const
  powerpc/numa: remove unreachable topology timer code
  powerpc/numa: remove unreachable topology workqueue code
  powerpc/numa: remove vphn_enabled and prrn_enabled internal flags
  powerpc/numa: stub out numa_update_cpu_topology()
  powerpc/numa: remove timed_topology_update()
  powerpc/numa: remove start/stop_topology_update()
  powerpc/rtasd: simplify handle_rtas_event(), emit message on events
  powerpc/numa: remove prrn_is_enabled()
  powerpc/numa: remove arch_update_cpu_topology
  powerpc/pseries: remove prrn special case from DT update path
  powerpc/pseries: remove memory "re-add" implementation
  powerpc/pseries: remove dlpar_cpu_readd()
  powerpc/pseries: remove obsolete memory hotplug DT notifier code

 Documentation/core-api/cpu_hotplug.rst        |   7 -
 arch/powerpc/include/asm/rtas.h               |   3 -
 arch/powerpc/include/asm/topology.h           |  27 -
 arch/powerpc/kernel/rtas.c                    | 122 +----
 arch/powerpc/kernel/rtasd.c                   |  28 +-
 arch/powerpc/mm/numa.c                        | 486 ------------------
 arch/powerpc/platforms/pseries/hotplug-cpu.c  | 189 +------
 .../platforms/pseries/hotplug-memory.c        | 107 +---
 arch/powerpc/platforms/pseries/mobility.c     |  31 --
 .../platforms/pseries/offline_states.h        |  38 --
 arch/powerpc/platforms/pseries/pmem.c         |   1 -
 arch/powerpc/platforms/pseries/smp.c          |  28 +-
 arch/powerpc/platforms/pseries/suspend.c      |  27 +-
 13 files changed, 22 insertions(+), 1072 deletions(-)
 delete mode 100644 arch/powerpc/platforms/pseries/offline_states.h

-- 
2.25.4


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 01/18] powerpc/pseries: remove cede offline state for CPUs
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-12  5:12 ` [PATCH 02/18] powerpc/rtas: don't online CPUs for partition suspend Nathan Lynch
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

This effectively reverts commit 3aa565f53c39 ("powerpc/pseries: Add
hooks to put the CPU into an appropriate offline state"), which added
an offline mode for CPUs which uses the H_CEDE hcall instead of the
architected stop-self RTAS function in order to facilitate "folding"
of dedicated mode processors on PowerVM platforms to achieve energy
savings. This has been the default offline mode since its
introduction.

There's nothing about stop-self that would prevent the hypervisor from
achieving the energy savings available via H_CEDE, so the original
premise of this change appears to be flawed.

I also have encountered the claim that the transition to and from
ceded state is much faster than stop-self/start-cpu. Certainly we
would not want to use stop-self as an *idle* mode. That is what H_CEDE
is for. However, this difference is insignificant in the context of
Linux CPU hotplug, where the latency of an offline or online operation
on current systems is on the order of 100ms, mainly attributable to
all the various subsystems' cpuhp callbacks.

The cede offline mode also prevents accurate accounting, as discussed
before:
https://lore.kernel.org/linuxppc-dev/1571740391-3251-1-git-send-email-ego@linux.vnet.ibm.com/

Unconditionally use stop-self to offline processor threads. This is
the architected method for offlining CPUs on PAPR systems.

The "cede_offline" boot parameter is rendered obsolete.

Removing this code enables the removal of the partition suspend code
which temporarily onlines all present CPUs.

Fixes: 3aa565f53c39 ("powerpc/pseries: Add hooks to put the CPU into an appropriate offline state")

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
---
 Documentation/core-api/cpu_hotplug.rst        |   7 -
 arch/powerpc/platforms/pseries/hotplug-cpu.c  | 170 ++----------------
 .../platforms/pseries/offline_states.h        |  38 ----
 arch/powerpc/platforms/pseries/pmem.c         |   1 -
 arch/powerpc/platforms/pseries/smp.c          |  28 +--
 5 files changed, 15 insertions(+), 229 deletions(-)
 delete mode 100644 arch/powerpc/platforms/pseries/offline_states.h

diff --git a/Documentation/core-api/cpu_hotplug.rst b/Documentation/core-api/cpu_hotplug.rst
index 4a50ab7817f7..b1ae1ac159cf 100644
--- a/Documentation/core-api/cpu_hotplug.rst
+++ b/Documentation/core-api/cpu_hotplug.rst
@@ -50,13 +50,6 @@ Command Line Switches
 
   This option is limited to the X86 and S390 architecture.
 
-``cede_offline={"off","on"}``
-  Use this option to disable/enable putting offlined processors to an extended
-  ``H_CEDE`` state on supported pseries platforms. If nothing is specified,
-  ``cede_offline`` is set to "on".
-
-  This option is limited to the PowerPC architecture.
-
 ``cpu0_hotplug``
   Allow to shutdown CPU0.
 
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 3e8cbfe7a80f..d4b346355bb9 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -35,54 +35,10 @@
 #include <asm/topology.h>
 
 #include "pseries.h"
-#include "offline_states.h"
 
 /* This version can't take the spinlock, because it never returns */
 static int rtas_stop_self_token = RTAS_UNKNOWN_SERVICE;
 
-static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) =
-							CPU_STATE_OFFLINE;
-static DEFINE_PER_CPU(enum cpu_state_vals, current_state) = CPU_STATE_OFFLINE;
-
-static enum cpu_state_vals default_offline_state = CPU_STATE_OFFLINE;
-
-static bool cede_offline_enabled __read_mostly = true;
-
-/*
- * Enable/disable cede_offline when available.
- */
-static int __init setup_cede_offline(char *str)
-{
-	return (kstrtobool(str, &cede_offline_enabled) == 0);
-}
-
-__setup("cede_offline=", setup_cede_offline);
-
-enum cpu_state_vals get_cpu_current_state(int cpu)
-{
-	return per_cpu(current_state, cpu);
-}
-
-void set_cpu_current_state(int cpu, enum cpu_state_vals state)
-{
-	per_cpu(current_state, cpu) = state;
-}
-
-enum cpu_state_vals get_preferred_offline_state(int cpu)
-{
-	return per_cpu(preferred_offline_state, cpu);
-}
-
-void set_preferred_offline_state(int cpu, enum cpu_state_vals state)
-{
-	per_cpu(preferred_offline_state, cpu) = state;
-}
-
-void set_default_offline_state(int cpu)
-{
-	per_cpu(preferred_offline_state, cpu) = default_offline_state;
-}
-
 static void rtas_stop_self(void)
 {
 	static struct rtas_args args;
@@ -101,9 +57,7 @@ static void rtas_stop_self(void)
 
 static void pseries_mach_cpu_die(void)
 {
-	unsigned int cpu = smp_processor_id();
 	unsigned int hwcpu = hard_smp_processor_id();
-	u8 cede_latency_hint = 0;
 
 	local_irq_disable();
 	idle_task_exit();
@@ -112,49 +66,6 @@ static void pseries_mach_cpu_die(void)
 	else
 		xics_teardown_cpu();
 
-	if (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) {
-		set_cpu_current_state(cpu, CPU_STATE_INACTIVE);
-		if (ppc_md.suspend_disable_cpu)
-			ppc_md.suspend_disable_cpu();
-
-		cede_latency_hint = 2;
-
-		get_lppaca()->idle = 1;
-		if (!lppaca_shared_proc(get_lppaca()))
-			get_lppaca()->donate_dedicated_cpu = 1;
-
-		while (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) {
-			while (!prep_irq_for_idle()) {
-				local_irq_enable();
-				local_irq_disable();
-			}
-
-			extended_cede_processor(cede_latency_hint);
-		}
-
-		local_irq_disable();
-
-		if (!lppaca_shared_proc(get_lppaca()))
-			get_lppaca()->donate_dedicated_cpu = 0;
-		get_lppaca()->idle = 0;
-
-		if (get_preferred_offline_state(cpu) == CPU_STATE_ONLINE) {
-			unregister_slb_shadow(hwcpu);
-
-			hard_irq_disable();
-			/*
-			 * Call to start_secondary_resume() will not return.
-			 * Kernel stack will be reset and start_secondary()
-			 * will be called to continue the online operation.
-			 */
-			start_secondary_resume();
-		}
-	}
-
-	/* Requested state is CPU_STATE_OFFLINE at this point */
-	WARN_ON(get_preferred_offline_state(cpu) != CPU_STATE_OFFLINE);
-
-	set_cpu_current_state(cpu, CPU_STATE_OFFLINE);
 	unregister_slb_shadow(hwcpu);
 	rtas_stop_self();
 
@@ -200,24 +111,13 @@ static void pseries_cpu_die(unsigned int cpu)
 	int cpu_status = 1;
 	unsigned int pcpu = get_hard_smp_processor_id(cpu);
 
-	if (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) {
-		cpu_status = 1;
-		for (tries = 0; tries < 5000; tries++) {
-			if (get_cpu_current_state(cpu) == CPU_STATE_INACTIVE) {
-				cpu_status = 0;
-				break;
-			}
-			msleep(1);
-		}
-	} else if (get_preferred_offline_state(cpu) == CPU_STATE_OFFLINE) {
+	for (tries = 0; tries < 25; tries++) {
+		cpu_status = smp_query_cpu_stopped(pcpu);
+		if (cpu_status == QCSS_STOPPED ||
+		    cpu_status == QCSS_HARDWARE_ERROR)
+			break;
+		cpu_relax();
 
-		for (tries = 0; tries < 25; tries++) {
-			cpu_status = smp_query_cpu_stopped(pcpu);
-			if (cpu_status == QCSS_STOPPED ||
-			    cpu_status == QCSS_HARDWARE_ERROR)
-				break;
-			cpu_relax();
-		}
 	}
 
 	if (cpu_status != 0) {
@@ -359,28 +259,15 @@ static int dlpar_offline_cpu(struct device_node *dn)
 			if (get_hard_smp_processor_id(cpu) != thread)
 				continue;
 
-			if (get_cpu_current_state(cpu) == CPU_STATE_OFFLINE)
+			if (!cpu_online(cpu))
 				break;
 
-			if (get_cpu_current_state(cpu) == CPU_STATE_ONLINE) {
-				set_preferred_offline_state(cpu,
-							    CPU_STATE_OFFLINE);
-				cpu_maps_update_done();
-				timed_topology_update(1);
-				rc = device_offline(get_cpu_device(cpu));
-				if (rc)
-					goto out;
-				cpu_maps_update_begin();
-				break;
-			}
-
-			/*
-			 * The cpu is in CPU_STATE_INACTIVE.
-			 * Upgrade it's state to CPU_STATE_OFFLINE.
-			 */
-			set_preferred_offline_state(cpu, CPU_STATE_OFFLINE);
-			WARN_ON(plpar_hcall_norets(H_PROD, thread) != H_SUCCESS);
-			__cpu_die(cpu);
+			cpu_maps_update_done();
+			timed_topology_update(1);
+			rc = device_offline(get_cpu_device(cpu));
+			if (rc)
+				goto out;
+			cpu_maps_update_begin();
 			break;
 		}
 		if (cpu == num_possible_cpus()) {
@@ -414,8 +301,6 @@ static int dlpar_online_cpu(struct device_node *dn)
 		for_each_present_cpu(cpu) {
 			if (get_hard_smp_processor_id(cpu) != thread)
 				continue;
-			BUG_ON(get_cpu_current_state(cpu)
-					!= CPU_STATE_OFFLINE);
 			cpu_maps_update_done();
 			timed_topology_update(1);
 			find_and_online_cpu_nid(cpu);
@@ -1013,27 +898,8 @@ static struct notifier_block pseries_smp_nb = {
 	.notifier_call = pseries_smp_notifier,
 };
 
-#define MAX_CEDE_LATENCY_LEVELS		4
-#define	CEDE_LATENCY_PARAM_LENGTH	10
-#define CEDE_LATENCY_PARAM_MAX_LENGTH	\
-	(MAX_CEDE_LATENCY_LEVELS * CEDE_LATENCY_PARAM_LENGTH * sizeof(char))
-#define CEDE_LATENCY_TOKEN		45
-
-static char cede_parameters[CEDE_LATENCY_PARAM_MAX_LENGTH];
-
-static int parse_cede_parameters(void)
-{
-	memset(cede_parameters, 0, CEDE_LATENCY_PARAM_MAX_LENGTH);
-	return rtas_call(rtas_token("ibm,get-system-parameter"), 3, 1,
-			 NULL,
-			 CEDE_LATENCY_TOKEN,
-			 __pa(cede_parameters),
-			 CEDE_LATENCY_PARAM_MAX_LENGTH);
-}
-
 static int __init pseries_cpu_hotplug_init(void)
 {
-	int cpu;
 	int qcss_tok;
 
 #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
@@ -1056,16 +922,8 @@ static int __init pseries_cpu_hotplug_init(void)
 	smp_ops->cpu_die = pseries_cpu_die;
 
 	/* Processors can be added/removed only on LPAR */
-	if (firmware_has_feature(FW_FEATURE_LPAR)) {
+	if (firmware_has_feature(FW_FEATURE_LPAR))
 		of_reconfig_notifier_register(&pseries_smp_nb);
-		cpu_maps_update_begin();
-		if (cede_offline_enabled && parse_cede_parameters() == 0) {
-			default_offline_state = CPU_STATE_INACTIVE;
-			for_each_online_cpu(cpu)
-				set_default_offline_state(cpu);
-		}
-		cpu_maps_update_done();
-	}
 
 	return 0;
 }
diff --git a/arch/powerpc/platforms/pseries/offline_states.h b/arch/powerpc/platforms/pseries/offline_states.h
deleted file mode 100644
index 51414aee2862..000000000000
--- a/arch/powerpc/platforms/pseries/offline_states.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef _OFFLINE_STATES_H_
-#define _OFFLINE_STATES_H_
-
-/* Cpu offline states go here */
-enum cpu_state_vals {
-	CPU_STATE_OFFLINE,
-	CPU_STATE_INACTIVE,
-	CPU_STATE_ONLINE,
-	CPU_MAX_OFFLINE_STATES
-};
-
-#ifdef CONFIG_HOTPLUG_CPU
-extern enum cpu_state_vals get_cpu_current_state(int cpu);
-extern void set_cpu_current_state(int cpu, enum cpu_state_vals state);
-extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state);
-extern void set_default_offline_state(int cpu);
-#else
-static inline enum cpu_state_vals get_cpu_current_state(int cpu)
-{
-	return CPU_STATE_ONLINE;
-}
-
-static inline void set_cpu_current_state(int cpu, enum cpu_state_vals state)
-{
-}
-
-static inline void set_preferred_offline_state(int cpu, enum cpu_state_vals state)
-{
-}
-
-static inline void set_default_offline_state(int cpu)
-{
-}
-#endif
-
-extern enum cpu_state_vals get_preferred_offline_state(int cpu);
-#endif
diff --git a/arch/powerpc/platforms/pseries/pmem.c b/arch/powerpc/platforms/pseries/pmem.c
index f860a897a9e0..f827de7087e9 100644
--- a/arch/powerpc/platforms/pseries/pmem.c
+++ b/arch/powerpc/platforms/pseries/pmem.c
@@ -24,7 +24,6 @@
 #include <asm/topology.h>
 
 #include "pseries.h"
-#include "offline_states.h"
 
 static struct device_node *pmem_node;
 
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 6891710833be..7ebacac03dc3 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -44,8 +44,6 @@
 #include <asm/svm.h>
 
 #include "pseries.h"
-#include "offline_states.h"
-
 
 /*
  * The Primary thread of each non-boot processor was started from the OF client
@@ -108,10 +106,7 @@ static inline int smp_startup_cpu(unsigned int lcpu)
 
 	/* Fixup atomic count: it exited inside IRQ handler. */
 	task_thread_info(paca_ptrs[lcpu]->__current)->preempt_count	= 0;
-#ifdef CONFIG_HOTPLUG_CPU
-	if (get_cpu_current_state(lcpu) == CPU_STATE_INACTIVE)
-		goto out;
-#endif
+
 	/* 
 	 * If the RTAS start-cpu token does not exist then presume the
 	 * cpu is already spinning.
@@ -126,9 +121,6 @@ static inline int smp_startup_cpu(unsigned int lcpu)
 		return 0;
 	}
 
-#ifdef CONFIG_HOTPLUG_CPU
-out:
-#endif
 	return 1;
 }
 
@@ -143,10 +135,6 @@ static void smp_setup_cpu(int cpu)
 		vpa_init(cpu);
 
 	cpumask_clear_cpu(cpu, of_spin_mask);
-#ifdef CONFIG_HOTPLUG_CPU
-	set_cpu_current_state(cpu, CPU_STATE_ONLINE);
-	set_default_offline_state(cpu);
-#endif
 }
 
 static int smp_pSeries_kick_cpu(int nr)
@@ -163,20 +151,6 @@ static int smp_pSeries_kick_cpu(int nr)
 	 * the processor will continue on to secondary_start
 	 */
 	paca_ptrs[nr]->cpu_start = 1;
-#ifdef CONFIG_HOTPLUG_CPU
-	set_preferred_offline_state(nr, CPU_STATE_ONLINE);
-
-	if (get_cpu_current_state(nr) == CPU_STATE_INACTIVE) {
-		long rc;
-		unsigned long hcpuid;
-
-		hcpuid = get_hard_smp_processor_id(nr);
-		rc = plpar_hcall_norets(H_PROD, hcpuid);
-		if (rc != H_SUCCESS)
-			printk(KERN_ERR "Error: Prod to wake up processor %d "
-						"Ret= %ld\n", nr, rc);
-	}
-#endif
 
 	return 0;
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 02/18] powerpc/rtas: don't online CPUs for partition suspend
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
  2020-06-12  5:12 ` [PATCH 01/18] powerpc/pseries: remove cede offline state for CPUs Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-12  5:12 ` [PATCH 03/18] powerpc/numa: remove ability to enable topology updates Nathan Lynch
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Partition suspension, used for hibernation and migration, requires
that the OS place all but one of the LPAR's processor threads into one
of two states prior to calling the ibm,suspend-me RTAS function:

  * the architected offline state (via RTAS stop-self); or
  * the H_JOIN hcall, which does not return until the partition
    resumes execution

Using H_CEDE as the offline mode, introduced by
commit 3aa565f53c39 ("powerpc/pseries: Add hooks to put the CPU into
an appropriate offline state"), means that any threads which are
offline from Linux's point of view must be moved to one of those two
states before a partition suspension can proceed.

This was eventually addressed in commit 120496ac2d2d ("powerpc: Bring
all threads online prior to migration/hibernation"), which added code
to temporarily bring up any offline processor threads so they can call
H_JOIN. Conceptually this is fine, but the implementation has had
multiple races with cpu hotplug operations initiated from user
space[1][2][3], the error handling is fragile, and it generates
user-visible cpu hotplug events which is a lot of noise for a platform
feature that's supposed to minimize disruption to workloads.

With commit 3aa565f53c39 ("powerpc/pseries: Add hooks to put the CPU
into an appropriate offline state") reverted, this code becomes
unnecessary, so remove it. Since any offline CPUs now are truly
offline from the platform's point of view, it is no longer necessary
to bring up CPUs only to have them call H_JOIN and then go offline
again upon resuming. Only active threads are required to call H_JOIN;
stopped threads can be left alone.

[1] commit a6717c01ddc2 ("powerpc/rtas: use device model APIs and
    serialization during LPM")
[2] commit 9fb603050ffd ("powerpc/rtas: retry when cpu offline races
    with suspend/migration")
[3] commit dfd718a2ed1f ("powerpc/rtas: Fix a potential race between
    CPU-Offline & Migration")

Fixes: 120496ac2d2d ("powerpc: Bring all threads online prior to migration/hibernation")
Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/include/asm/rtas.h          |   2 -
 arch/powerpc/kernel/rtas.c               | 122 +----------------------
 arch/powerpc/platforms/pseries/suspend.c |  22 +---
 3 files changed, 3 insertions(+), 143 deletions(-)

diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 014968f25f7e..0107d724e9da 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -253,8 +253,6 @@ extern int rtas_set_indicator_fast(int indicator, int index, int new_value);
 extern void rtas_progress(char *s, unsigned short hex);
 extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data);
 extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data);
-extern int rtas_online_cpus_mask(cpumask_var_t cpus);
-extern int rtas_offline_cpus_mask(cpumask_var_t cpus);
 extern int rtas_ibm_suspend_me(u64 handle);
 
 struct rtc_time;
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index a09eba03f180..806d554ce357 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -843,96 +843,6 @@ static void rtas_percpu_suspend_me(void *info)
 	__rtas_suspend_cpu((struct rtas_suspend_me_data *)info, 1);
 }
 
-enum rtas_cpu_state {
-	DOWN,
-	UP,
-};
-
-#ifndef CONFIG_SMP
-static int rtas_cpu_state_change_mask(enum rtas_cpu_state state,
-				cpumask_var_t cpus)
-{
-	if (!cpumask_empty(cpus)) {
-		cpumask_clear(cpus);
-		return -EINVAL;
-	} else
-		return 0;
-}
-#else
-/* On return cpumask will be altered to indicate CPUs changed.
- * CPUs with states changed will be set in the mask,
- * CPUs with status unchanged will be unset in the mask. */
-static int rtas_cpu_state_change_mask(enum rtas_cpu_state state,
-				cpumask_var_t cpus)
-{
-	int cpu;
-	int cpuret = 0;
-	int ret = 0;
-
-	if (cpumask_empty(cpus))
-		return 0;
-
-	for_each_cpu(cpu, cpus) {
-		struct device *dev = get_cpu_device(cpu);
-
-		switch (state) {
-		case DOWN:
-			cpuret = device_offline(dev);
-			break;
-		case UP:
-			cpuret = device_online(dev);
-			break;
-		}
-		if (cpuret < 0) {
-			pr_debug("%s: cpu_%s for cpu#%d returned %d.\n",
-					__func__,
-					((state == UP) ? "up" : "down"),
-					cpu, cpuret);
-			if (!ret)
-				ret = cpuret;
-			if (state == UP) {
-				/* clear bits for unchanged cpus, return */
-				cpumask_shift_right(cpus, cpus, cpu);
-				cpumask_shift_left(cpus, cpus, cpu);
-				break;
-			} else {
-				/* clear bit for unchanged cpu, continue */
-				cpumask_clear_cpu(cpu, cpus);
-			}
-		}
-		cond_resched();
-	}
-
-	return ret;
-}
-#endif
-
-int rtas_online_cpus_mask(cpumask_var_t cpus)
-{
-	int ret;
-
-	ret = rtas_cpu_state_change_mask(UP, cpus);
-
-	if (ret) {
-		cpumask_var_t tmp_mask;
-
-		if (!alloc_cpumask_var(&tmp_mask, GFP_KERNEL))
-			return ret;
-
-		/* Use tmp_mask to preserve cpus mask from first failure */
-		cpumask_copy(tmp_mask, cpus);
-		rtas_offline_cpus_mask(tmp_mask);
-		free_cpumask_var(tmp_mask);
-	}
-
-	return ret;
-}
-
-int rtas_offline_cpus_mask(cpumask_var_t cpus)
-{
-	return rtas_cpu_state_change_mask(DOWN, cpus);
-}
-
 int rtas_ibm_suspend_me(u64 handle)
 {
 	long state;
@@ -940,8 +850,6 @@ int rtas_ibm_suspend_me(u64 handle)
 	unsigned long retbuf[PLPAR_HCALL_BUFSIZE];
 	struct rtas_suspend_me_data data;
 	DECLARE_COMPLETION_ONSTACK(done);
-	cpumask_var_t offline_mask;
-	int cpuret;
 
 	if (!rtas_service_present("ibm,suspend-me"))
 		return -ENOSYS;
@@ -962,9 +870,6 @@ int rtas_ibm_suspend_me(u64 handle)
 		return -EIO;
 	}
 
-	if (!alloc_cpumask_var(&offline_mask, GFP_KERNEL))
-		return -ENOMEM;
-
 	atomic_set(&data.working, 0);
 	atomic_set(&data.done, 0);
 	atomic_set(&data.error, 0);
@@ -973,24 +878,8 @@ int rtas_ibm_suspend_me(u64 handle)
 
 	lock_device_hotplug();
 
-	/* All present CPUs must be online */
-	cpumask_andnot(offline_mask, cpu_present_mask, cpu_online_mask);
-	cpuret = rtas_online_cpus_mask(offline_mask);
-	if (cpuret) {
-		pr_err("%s: Could not bring present CPUs online.\n", __func__);
-		atomic_set(&data.error, cpuret);
-		goto out;
-	}
-
 	cpu_hotplug_disable();
 
-	/* Check if we raced with a CPU-Offline Operation */
-	if (!cpumask_equal(cpu_present_mask, cpu_online_mask)) {
-		pr_info("%s: Raced against a concurrent CPU-Offline\n", __func__);
-		atomic_set(&data.error, -EAGAIN);
-		goto out_hotplug_enable;
-	}
-
 	/* Call function on all CPUs.  One of us will make the
 	 * rtas call
 	 */
@@ -1001,18 +890,11 @@ int rtas_ibm_suspend_me(u64 handle)
 	if (atomic_read(&data.error) != 0)
 		printk(KERN_ERR "Error doing global join\n");
 
-out_hotplug_enable:
-	cpu_hotplug_enable();
 
-	/* Take down CPUs not online prior to suspend */
-	cpuret = rtas_offline_cpus_mask(offline_mask);
-	if (cpuret)
-		pr_warn("%s: Could not restore CPUs to offline state.\n",
-				__func__);
+	cpu_hotplug_enable();
 
-out:
 	unlock_device_hotplug();
-	free_cpumask_var(offline_mask);
+
 	return atomic_read(&data.error);
 }
 
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index 0a24a5a185f0..f789693f61f4 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -132,15 +132,11 @@ static ssize_t store_hibernate(struct device *dev,
 			       struct device_attribute *attr,
 			       const char *buf, size_t count)
 {
-	cpumask_var_t offline_mask;
 	int rc;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	if (!alloc_cpumask_var(&offline_mask, GFP_KERNEL))
-		return -ENOMEM;
-
 	stream_id = simple_strtoul(buf, NULL, 16);
 
 	do {
@@ -150,32 +146,16 @@ static ssize_t store_hibernate(struct device *dev,
 	} while (rc == -EAGAIN);
 
 	if (!rc) {
-		/* All present CPUs must be online */
-		cpumask_andnot(offline_mask, cpu_present_mask,
-				cpu_online_mask);
-		rc = rtas_online_cpus_mask(offline_mask);
-		if (rc) {
-			pr_err("%s: Could not bring present CPUs online.\n",
-					__func__);
-			goto out;
-		}
-
 		stop_topology_update();
 		rc = pm_suspend(PM_SUSPEND_MEM);
 		start_topology_update();
-
-		/* Take down CPUs not online prior to suspend */
-		if (!rtas_offline_cpus_mask(offline_mask))
-			pr_warn("%s: Could not restore CPUs to offline "
-					"state.\n", __func__);
 	}
 
 	stream_id = 0;
 
 	if (!rc)
 		rc = count;
-out:
-	free_cpumask_var(offline_mask);
+
 	return rc;
 }
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 03/18] powerpc/numa: remove ability to enable topology updates
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
  2020-06-12  5:12 ` [PATCH 01/18] powerpc/pseries: remove cede offline state for CPUs Nathan Lynch
  2020-06-12  5:12 ` [PATCH 02/18] powerpc/rtas: don't online CPUs for partition suspend Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:23   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 04/18] powerpc/numa: remove unreachable topology update code Nathan Lynch
                   ` (15 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Remove the /proc/powerpc/topology_updates interface and the
topology_updates=on/off command line argument. The internal
topology_updates_enabled flag remains for now, but always false.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 71 +-----------------------------------------
 1 file changed, 1 insertion(+), 70 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 9fcf2d195830..34d95de77bdd 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -984,27 +984,7 @@ static int __init early_numa(char *p)
 }
 early_param("numa", early_numa);
 
-/*
- * The platform can inform us through one of several mechanisms
- * (post-migration device tree updates, PRRN or VPHN) that the NUMA
- * assignment of a resource has changed. This controls whether we act
- * on that. Disabled by default.
- */
-static bool topology_updates_enabled;
-
-static int __init early_topology_updates(char *p)
-{
-	if (!p)
-		return 0;
-
-	if (!strcmp(p, "on")) {
-		pr_warn("Caution: enabling topology updates\n");
-		topology_updates_enabled = true;
-	}
-
-	return 0;
-}
-early_param("topology_updates", early_topology_updates);
+static const bool topology_updates_enabled;
 
 #ifdef CONFIG_MEMORY_HOTPLUG
 /*
@@ -1632,52 +1612,6 @@ int prrn_is_enabled(void)
 	return prrn_enabled;
 }
 
-static int topology_read(struct seq_file *file, void *v)
-{
-	if (vphn_enabled || prrn_enabled)
-		seq_puts(file, "on\n");
-	else
-		seq_puts(file, "off\n");
-
-	return 0;
-}
-
-static int topology_open(struct inode *inode, struct file *file)
-{
-	return single_open(file, topology_read, NULL);
-}
-
-static ssize_t topology_write(struct file *file, const char __user *buf,
-			      size_t count, loff_t *off)
-{
-	char kbuf[4]; /* "on" or "off" plus null. */
-	int read_len;
-
-	read_len = count < 3 ? count : 3;
-	if (copy_from_user(kbuf, buf, read_len))
-		return -EINVAL;
-
-	kbuf[read_len] = '\0';
-
-	if (!strncmp(kbuf, "on", 2)) {
-		topology_updates_enabled = true;
-		start_topology_update();
-	} else if (!strncmp(kbuf, "off", 3)) {
-		stop_topology_update();
-		topology_updates_enabled = false;
-	} else
-		return -EINVAL;
-
-	return count;
-}
-
-static const struct proc_ops topology_proc_ops = {
-	.proc_read	= seq_read,
-	.proc_write	= topology_write,
-	.proc_open	= topology_open,
-	.proc_release	= single_release,
-};
-
 static int topology_update_init(void)
 {
 	start_topology_update();
@@ -1685,9 +1619,6 @@ static int topology_update_init(void)
 	if (vphn_enabled)
 		topology_schedule_update();
 
-	if (!proc_create("powerpc/topology_updates", 0644, NULL, &topology_proc_ops))
-		return -ENOMEM;
-
 	topology_inited = 1;
 	return 0;
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 04/18] powerpc/numa: remove unreachable topology update code
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (2 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 03/18] powerpc/numa: remove ability to enable topology updates Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:24   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const Nathan Lynch
                   ` (14 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Since the topology_updates_enabled flag is now always false, remove it
and the code which has become unreachable. This is the minimum change
that prevents 'defined but unused' warnings emitted by the compiler
after stubbing out the start/stop_topology_updates() functions.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 149 +----------------------------------------
 1 file changed, 2 insertions(+), 147 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 34d95de77bdd..9e20f12e6caf 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -984,8 +984,6 @@ static int __init early_numa(char *p)
 }
 early_param("numa", early_numa);
 
-static const bool topology_updates_enabled;
-
 #ifdef CONFIG_MEMORY_HOTPLUG
 /*
  * Find the node associated with a hot added memory section for
@@ -1133,7 +1131,6 @@ struct topology_update_data {
 
 #define TOPOLOGY_DEF_TIMER_SECS	60
 
-static u8 vphn_cpu_change_counts[NR_CPUS][MAX_DISTANCE_REF_POINTS];
 static cpumask_t cpu_associativity_changes_mask;
 static int vphn_enabled;
 static int prrn_enabled;
@@ -1158,63 +1155,6 @@ int timed_topology_update(int nsecs)
 	return 0;
 }
 
-/*
- * Store the current values of the associativity change counters in the
- * hypervisor.
- */
-static void setup_cpu_associativity_change_counters(void)
-{
-	int cpu;
-
-	/* The VPHN feature supports a maximum of 8 reference points */
-	BUILD_BUG_ON(MAX_DISTANCE_REF_POINTS > 8);
-
-	for_each_possible_cpu(cpu) {
-		int i;
-		u8 *counts = vphn_cpu_change_counts[cpu];
-		volatile u8 *hypervisor_counts = lppaca_of(cpu).vphn_assoc_counts;
-
-		for (i = 0; i < distance_ref_points_depth; i++)
-			counts[i] = hypervisor_counts[i];
-	}
-}
-
-/*
- * The hypervisor maintains a set of 8 associativity change counters in
- * the VPA of each cpu that correspond to the associativity levels in the
- * ibm,associativity-reference-points property. When an associativity
- * level changes, the corresponding counter is incremented.
- *
- * Set a bit in cpu_associativity_changes_mask for each cpu whose home
- * node associativity levels have changed.
- *
- * Returns the number of cpus with unhandled associativity changes.
- */
-static int update_cpu_associativity_changes_mask(void)
-{
-	int cpu;
-	cpumask_t *changes = &cpu_associativity_changes_mask;
-
-	for_each_possible_cpu(cpu) {
-		int i, changed = 0;
-		u8 *counts = vphn_cpu_change_counts[cpu];
-		volatile u8 *hypervisor_counts = lppaca_of(cpu).vphn_assoc_counts;
-
-		for (i = 0; i < distance_ref_points_depth; i++) {
-			if (hypervisor_counts[i] != counts[i]) {
-				counts[i] = hypervisor_counts[i];
-				changed = 1;
-			}
-		}
-		if (changed) {
-			cpumask_or(changes, changes, cpu_sibling_mask(cpu));
-			cpu = cpu_last_thread_sibling(cpu);
-		}
-	}
-
-	return cpumask_weight(changes);
-}
-
 /*
  * Retrieve the new associativity information for a virtual processor's
  * home node.
@@ -1498,16 +1438,6 @@ static void topology_schedule_update(void)
 	schedule_work(&topology_work);
 }
 
-static void topology_timer_fn(struct timer_list *unused)
-{
-	if (prrn_enabled && cpumask_weight(&cpu_associativity_changes_mask))
-		topology_schedule_update();
-	else if (vphn_enabled) {
-		if (update_cpu_associativity_changes_mask() > 0)
-			topology_schedule_update();
-		reset_topology_timer();
-	}
-}
 static struct timer_list topology_timer;
 
 static void reset_topology_timer(void)
@@ -1516,69 +1446,12 @@ static void reset_topology_timer(void)
 		mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ);
 }
 
-#ifdef CONFIG_SMP
-
-static int dt_update_callback(struct notifier_block *nb,
-				unsigned long action, void *data)
-{
-	struct of_reconfig_data *update = data;
-	int rc = NOTIFY_DONE;
-
-	switch (action) {
-	case OF_RECONFIG_UPDATE_PROPERTY:
-		if (of_node_is_type(update->dn, "cpu") &&
-		    !of_prop_cmp(update->prop->name, "ibm,associativity")) {
-			u32 core_id;
-			of_property_read_u32(update->dn, "reg", &core_id);
-			rc = dlpar_cpu_readd(core_id);
-			rc = NOTIFY_OK;
-		}
-		break;
-	}
-
-	return rc;
-}
-
-static struct notifier_block dt_update_nb = {
-	.notifier_call = dt_update_callback,
-};
-
-#endif
-
 /*
  * Start polling for associativity changes.
  */
 int start_topology_update(void)
 {
-	int rc = 0;
-
-	if (!topology_updates_enabled)
-		return 0;
-
-	if (firmware_has_feature(FW_FEATURE_PRRN)) {
-		if (!prrn_enabled) {
-			prrn_enabled = 1;
-#ifdef CONFIG_SMP
-			rc = of_reconfig_notifier_register(&dt_update_nb);
-#endif
-		}
-	}
-	if (firmware_has_feature(FW_FEATURE_VPHN) &&
-		   lppaca_shared_proc(get_lppaca())) {
-		if (!vphn_enabled) {
-			vphn_enabled = 1;
-			setup_cpu_associativity_change_counters();
-			timer_setup(&topology_timer, topology_timer_fn,
-				    TIMER_DEFERRABLE);
-			reset_topology_timer();
-		}
-	}
-
-	pr_info("Starting topology update%s%s\n",
-		(prrn_enabled ? " prrn_enabled" : ""),
-		(vphn_enabled ? " vphn_enabled" : ""));
-
-	return rc;
+	return 0;
 }
 
 /*
@@ -1586,25 +1459,7 @@ int start_topology_update(void)
  */
 int stop_topology_update(void)
 {
-	int rc = 0;
-
-	if (!topology_updates_enabled)
-		return 0;
-
-	if (prrn_enabled) {
-		prrn_enabled = 0;
-#ifdef CONFIG_SMP
-		rc = of_reconfig_notifier_unregister(&dt_update_nb);
-#endif
-	}
-	if (vphn_enabled) {
-		vphn_enabled = 0;
-		rc = del_timer_sync(&topology_timer);
-	}
-
-	pr_info("Stopping topology update\n");
-
-	return rc;
+	return 0;
 }
 
 int prrn_is_enabled(void)
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (3 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 04/18] powerpc/numa: remove unreachable topology update code Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:24   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 06/18] powerpc/numa: remove unreachable topology timer code Nathan Lynch
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Previous changes have made it so these flags are never changed;
enforce this by making them const.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 9e20f12e6caf..1b89bacb8975 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1132,8 +1132,8 @@ struct topology_update_data {
 #define TOPOLOGY_DEF_TIMER_SECS	60
 
 static cpumask_t cpu_associativity_changes_mask;
-static int vphn_enabled;
-static int prrn_enabled;
+static const int vphn_enabled;
+static const int prrn_enabled;
 static void reset_topology_timer(void);
 static int topology_timer_secs = 1;
 static int topology_inited;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 06/18] powerpc/numa: remove unreachable topology timer code
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (4 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:25   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 07/18] powerpc/numa: remove unreachable topology workqueue code Nathan Lynch
                   ` (12 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Since vphn_enabled is always 0, we can stub out
timed_topology_update() and remove the code which becomes unreachable.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 1b89bacb8975..6207297490a8 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1129,13 +1129,9 @@ struct topology_update_data {
 	int new_nid;
 };
 
-#define TOPOLOGY_DEF_TIMER_SECS	60
-
 static cpumask_t cpu_associativity_changes_mask;
 static const int vphn_enabled;
 static const int prrn_enabled;
-static void reset_topology_timer(void);
-static int topology_timer_secs = 1;
 static int topology_inited;
 
 /*
@@ -1143,15 +1139,6 @@ static int topology_inited;
  */
 int timed_topology_update(int nsecs)
 {
-	if (vphn_enabled) {
-		if (nsecs > 0)
-			topology_timer_secs = nsecs;
-		else
-			topology_timer_secs = TOPOLOGY_DEF_TIMER_SECS;
-
-		reset_topology_timer();
-	}
-
 	return 0;
 }
 
@@ -1438,14 +1425,6 @@ static void topology_schedule_update(void)
 	schedule_work(&topology_work);
 }
 
-static struct timer_list topology_timer;
-
-static void reset_topology_timer(void)
-{
-	if (vphn_enabled)
-		mod_timer(&topology_timer, jiffies + topology_timer_secs * HZ);
-}
-
 /*
  * Start polling for associativity changes.
  */
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 07/18] powerpc/numa: remove unreachable topology workqueue code
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (5 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 06/18] powerpc/numa: remove unreachable topology timer code Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:26   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags Nathan Lynch
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Since vphn_enabled is always 0, we can remove the call to
topology_schedule_update() and remove the code which becomes
unreachable as a result.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 6207297490a8..8415481a7f13 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1414,17 +1414,6 @@ int arch_update_cpu_topology(void)
 	return numa_update_cpu_topology(true);
 }
 
-static void topology_work_fn(struct work_struct *work)
-{
-	rebuild_sched_domains();
-}
-static DECLARE_WORK(topology_work, topology_work_fn);
-
-static void topology_schedule_update(void)
-{
-	schedule_work(&topology_work);
-}
-
 /*
  * Start polling for associativity changes.
  */
@@ -1450,9 +1439,6 @@ static int topology_update_init(void)
 {
 	start_topology_update();
 
-	if (vphn_enabled)
-		topology_schedule_update();
-
 	topology_inited = 1;
 	return 0;
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (6 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 07/18] powerpc/numa: remove unreachable topology workqueue code Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:27   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 09/18] powerpc/numa: stub out numa_update_cpu_topology() Nathan Lynch
                   ` (10 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

These flags are always zero now; remove them and suitably adjust the
remaining references to them.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 8415481a7f13..8749d7f2b1a6 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1130,8 +1130,6 @@ struct topology_update_data {
 };
 
 static cpumask_t cpu_associativity_changes_mask;
-static const int vphn_enabled;
-static const int prrn_enabled;
 static int topology_inited;
 
 /*
@@ -1292,7 +1290,7 @@ int numa_update_cpu_topology(bool cpus_locked)
 	struct device *dev;
 	int weight, new_nid, i = 0;
 
-	if (!prrn_enabled && !vphn_enabled && topology_inited)
+	if (topology_inited)
 		return 0;
 
 	weight = cpumask_weight(&cpu_associativity_changes_mask);
@@ -1432,7 +1430,7 @@ int stop_topology_update(void)
 
 int prrn_is_enabled(void)
 {
-	return prrn_enabled;
+	return 0;
 }
 
 static int topology_update_init(void)
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 09/18] powerpc/numa: stub out numa_update_cpu_topology()
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (7 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:27   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 10/18] powerpc/numa: remove timed_topology_update() Nathan Lynch
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Previous changes have removed the code which sets bits in
cpu_associativity_changes_mask and thus it is never modifed at
runtime. From this we can reason that numa_update_cpu_topology()
always returns 0 without doing anything. Remove the body of
numa_update_cpu_topology() and remove all code which becomes
unreachable as a result.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/mm/numa.c | 193 +----------------------------------------
 1 file changed, 1 insertion(+), 192 deletions(-)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 8749d7f2b1a6..b220e5b60140 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1122,14 +1122,6 @@ u64 memory_hotplug_max(void)
 
 /* Virtual Processor Home Node (VPHN) support */
 #ifdef CONFIG_PPC_SPLPAR
-struct topology_update_data {
-	struct topology_update_data *next;
-	unsigned int cpu;
-	int old_nid;
-	int new_nid;
-};
-
-static cpumask_t cpu_associativity_changes_mask;
 static int topology_inited;
 
 /*
@@ -1219,192 +1211,9 @@ int find_and_online_cpu_nid(int cpu)
 	return new_nid;
 }
 
-/*
- * Update the CPU maps and sysfs entries for a single CPU when its NUMA
- * characteristics change. This function doesn't perform any locking and is
- * only safe to call from stop_machine().
- */
-static int update_cpu_topology(void *data)
-{
-	struct topology_update_data *update;
-	unsigned long cpu;
-
-	if (!data)
-		return -EINVAL;
-
-	cpu = smp_processor_id();
-
-	for (update = data; update; update = update->next) {
-		int new_nid = update->new_nid;
-		if (cpu != update->cpu)
-			continue;
-
-		unmap_cpu_from_node(cpu);
-		map_cpu_to_node(cpu, new_nid);
-		set_cpu_numa_node(cpu, new_nid);
-		set_cpu_numa_mem(cpu, local_memory_node(new_nid));
-		vdso_getcpu_init();
-	}
-
-	return 0;
-}
-
-static int update_lookup_table(void *data)
-{
-	struct topology_update_data *update;
-
-	if (!data)
-		return -EINVAL;
-
-	/*
-	 * Upon topology update, the numa-cpu lookup table needs to be updated
-	 * for all threads in the core, including offline CPUs, to ensure that
-	 * future hotplug operations respect the cpu-to-node associativity
-	 * properly.
-	 */
-	for (update = data; update; update = update->next) {
-		int nid, base, j;
-
-		nid = update->new_nid;
-		base = cpu_first_thread_sibling(update->cpu);
-
-		for (j = 0; j < threads_per_core; j++) {
-			update_numa_cpu_lookup_table(base + j, nid);
-		}
-	}
-
-	return 0;
-}
-
-/*
- * Update the node maps and sysfs entries for each cpu whose home node
- * has changed. Returns 1 when the topology has changed, and 0 otherwise.
- *
- * cpus_locked says whether we already hold cpu_hotplug_lock.
- */
 int numa_update_cpu_topology(bool cpus_locked)
 {
-	unsigned int cpu, sibling, changed = 0;
-	struct topology_update_data *updates, *ud;
-	cpumask_t updated_cpus;
-	struct device *dev;
-	int weight, new_nid, i = 0;
-
-	if (topology_inited)
-		return 0;
-
-	weight = cpumask_weight(&cpu_associativity_changes_mask);
-	if (!weight)
-		return 0;
-
-	updates = kcalloc(weight, sizeof(*updates), GFP_KERNEL);
-	if (!updates)
-		return 0;
-
-	cpumask_clear(&updated_cpus);
-
-	for_each_cpu(cpu, &cpu_associativity_changes_mask) {
-		/*
-		 * If siblings aren't flagged for changes, updates list
-		 * will be too short. Skip on this update and set for next
-		 * update.
-		 */
-		if (!cpumask_subset(cpu_sibling_mask(cpu),
-					&cpu_associativity_changes_mask)) {
-			pr_info("Sibling bits not set for associativity "
-					"change, cpu%d\n", cpu);
-			cpumask_or(&cpu_associativity_changes_mask,
-					&cpu_associativity_changes_mask,
-					cpu_sibling_mask(cpu));
-			cpu = cpu_last_thread_sibling(cpu);
-			continue;
-		}
-
-		new_nid = find_and_online_cpu_nid(cpu);
-
-		if (new_nid == numa_cpu_lookup_table[cpu]) {
-			cpumask_andnot(&cpu_associativity_changes_mask,
-					&cpu_associativity_changes_mask,
-					cpu_sibling_mask(cpu));
-			dbg("Assoc chg gives same node %d for cpu%d\n",
-					new_nid, cpu);
-			cpu = cpu_last_thread_sibling(cpu);
-			continue;
-		}
-
-		for_each_cpu(sibling, cpu_sibling_mask(cpu)) {
-			ud = &updates[i++];
-			ud->next = &updates[i];
-			ud->cpu = sibling;
-			ud->new_nid = new_nid;
-			ud->old_nid = numa_cpu_lookup_table[sibling];
-			cpumask_set_cpu(sibling, &updated_cpus);
-		}
-		cpu = cpu_last_thread_sibling(cpu);
-	}
-
-	/*
-	 * Prevent processing of 'updates' from overflowing array
-	 * where last entry filled in a 'next' pointer.
-	 */
-	if (i)
-		updates[i-1].next = NULL;
-
-	pr_debug("Topology update for the following CPUs:\n");
-	if (cpumask_weight(&updated_cpus)) {
-		for (ud = &updates[0]; ud; ud = ud->next) {
-			pr_debug("cpu %d moving from node %d "
-					  "to %d\n", ud->cpu,
-					  ud->old_nid, ud->new_nid);
-		}
-	}
-
-	/*
-	 * In cases where we have nothing to update (because the updates list
-	 * is too short or because the new topology is same as the old one),
-	 * skip invoking update_cpu_topology() via stop-machine(). This is
-	 * necessary (and not just a fast-path optimization) since stop-machine
-	 * can end up electing a random CPU to run update_cpu_topology(), and
-	 * thus trick us into setting up incorrect cpu-node mappings (since
-	 * 'updates' is kzalloc()'ed).
-	 *
-	 * And for the similar reason, we will skip all the following updating.
-	 */
-	if (!cpumask_weight(&updated_cpus))
-		goto out;
-
-	if (cpus_locked)
-		stop_machine_cpuslocked(update_cpu_topology, &updates[0],
-					&updated_cpus);
-	else
-		stop_machine(update_cpu_topology, &updates[0], &updated_cpus);
-
-	/*
-	 * Update the numa-cpu lookup table with the new mappings, even for
-	 * offline CPUs. It is best to perform this update from the stop-
-	 * machine context.
-	 */
-	if (cpus_locked)
-		stop_machine_cpuslocked(update_lookup_table, &updates[0],
-					cpumask_of(raw_smp_processor_id()));
-	else
-		stop_machine(update_lookup_table, &updates[0],
-			     cpumask_of(raw_smp_processor_id()));
-
-	for (ud = &updates[0]; ud; ud = ud->next) {
-		unregister_cpu_under_node(ud->cpu, ud->old_nid);
-		register_cpu_under_node(ud->cpu, ud->new_nid);
-
-		dev = get_cpu_device(ud->cpu);
-		if (dev)
-			kobject_uevent(&dev->kobj, KOBJ_CHANGE);
-		cpumask_clear_cpu(ud->cpu, &cpu_associativity_changes_mask);
-		changed = 1;
-	}
-
-out:
-	kfree(updates);
-	return changed;
+	return 0;
 }
 
 int arch_update_cpu_topology(void)
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 10/18] powerpc/numa: remove timed_topology_update()
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (8 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 09/18] powerpc/numa: stub out numa_update_cpu_topology() Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:28   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 11/18] powerpc/numa: remove start/stop_topology_update() Nathan Lynch
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

timed_topology_update is a no-op now, so remove it and all call sites.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/include/asm/topology.h          | 5 -----
 arch/powerpc/mm/numa.c                       | 9 ---------
 arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 --
 3 files changed, 16 deletions(-)

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 2db7ba789720..379e2cc3789f 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -97,7 +97,6 @@ extern int start_topology_update(void);
 extern int stop_topology_update(void);
 extern int prrn_is_enabled(void);
 extern int find_and_online_cpu_nid(int cpu);
-extern int timed_topology_update(int nsecs);
 #else
 static inline int start_topology_update(void)
 {
@@ -115,10 +114,6 @@ static inline int find_and_online_cpu_nid(int cpu)
 {
 	return 0;
 }
-static inline int timed_topology_update(int nsecs)
-{
-	return 0;
-}
 
 #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
 
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b220e5b60140..6c579ac3e679 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1124,14 +1124,6 @@ u64 memory_hotplug_max(void)
 #ifdef CONFIG_PPC_SPLPAR
 static int topology_inited;
 
-/*
- * Change polling interval for associativity changes.
- */
-int timed_topology_update(int nsecs)
-{
-	return 0;
-}
-
 /*
  * Retrieve the new associativity information for a virtual processor's
  * home node.
@@ -1147,7 +1139,6 @@ static long vphn_get_associativity(unsigned long cpu,
 	switch (rc) {
 	case H_SUCCESS:
 		dbg("VPHN hcall succeeded. Reset polling...\n");
-		timed_topology_update(0);
 		goto out;
 
 	case H_FUNCTION:
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index d4b346355bb9..dbfabb185eb5 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -263,7 +263,6 @@ static int dlpar_offline_cpu(struct device_node *dn)
 				break;
 
 			cpu_maps_update_done();
-			timed_topology_update(1);
 			rc = device_offline(get_cpu_device(cpu));
 			if (rc)
 				goto out;
@@ -302,7 +301,6 @@ static int dlpar_online_cpu(struct device_node *dn)
 			if (get_hard_smp_processor_id(cpu) != thread)
 				continue;
 			cpu_maps_update_done();
-			timed_topology_update(1);
 			find_and_online_cpu_nid(cpu);
 			rc = device_online(get_cpu_device(cpu));
 			if (rc) {
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 11/18] powerpc/numa: remove start/stop_topology_update()
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (9 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 10/18] powerpc/numa: remove timed_topology_update() Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:28   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events Nathan Lynch
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

These APIs have become no-ops, so remove them and all call sites.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/include/asm/topology.h       | 10 ----------
 arch/powerpc/mm/numa.c                    | 20 --------------------
 arch/powerpc/platforms/pseries/mobility.c |  4 ----
 arch/powerpc/platforms/pseries/suspend.c  |  5 +----
 4 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 379e2cc3789f..537c638582eb 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -93,19 +93,9 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
 #endif /* CONFIG_NUMA */
 
 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
-extern int start_topology_update(void);
-extern int stop_topology_update(void);
 extern int prrn_is_enabled(void);
 extern int find_and_online_cpu_nid(int cpu);
 #else
-static inline int start_topology_update(void)
-{
-	return 0;
-}
-static inline int stop_topology_update(void)
-{
-	return 0;
-}
 static inline int prrn_is_enabled(void)
 {
 	return 0;
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 6c579ac3e679..dec7ce3b5e67 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1157,8 +1157,6 @@ static long vphn_get_associativity(unsigned long cpu,
 			, rc);
 		break;
 	}
-
-	stop_topology_update();
 out:
 	return rc;
 }
@@ -1212,22 +1210,6 @@ int arch_update_cpu_topology(void)
 	return numa_update_cpu_topology(true);
 }
 
-/*
- * Start polling for associativity changes.
- */
-int start_topology_update(void)
-{
-	return 0;
-}
-
-/*
- * Disable polling for VPHN associativity changes.
- */
-int stop_topology_update(void)
-{
-	return 0;
-}
-
 int prrn_is_enabled(void)
 {
 	return 0;
@@ -1235,8 +1217,6 @@ int prrn_is_enabled(void)
 
 static int topology_update_init(void)
 {
-	start_topology_update();
-
 	topology_inited = 1;
 	return 0;
 }
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 10d982997736..c0b09f6f0ae3 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -388,8 +388,6 @@ static ssize_t migration_store(struct class *class,
 	if (rc)
 		return rc;
 
-	stop_topology_update();
-
 	do {
 		rc = rtas_ibm_suspend_me(streamid);
 		if (rc == -EAGAIN)
@@ -401,8 +399,6 @@ static ssize_t migration_store(struct class *class,
 
 	post_mobility_fixup();
 
-	start_topology_update();
-
 	return count;
 }
 
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index f789693f61f4..81e0ac58d620 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -145,11 +145,8 @@ static ssize_t store_hibernate(struct device *dev,
 			ssleep(1);
 	} while (rc == -EAGAIN);
 
-	if (!rc) {
-		stop_topology_update();
+	if (!rc)
 		rc = pm_suspend(PM_SUSPEND_MEM);
-		start_topology_update();
-	}
 
 	stream_id = 0;
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (10 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 11/18] powerpc/numa: remove start/stop_topology_update() Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:30   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 13/18] powerpc/numa: remove prrn_is_enabled() Nathan Lynch
                   ` (6 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

prrn_is_enabled() always returns false/0, so handle_rtas_event() can
be simplified and some dead code can be removed. Use machine_is()
instead of #ifdef to run this code only on pseries, and add an
informational ratelimited message that we are ignoring the
events. PRRN events are relatively rare in normal operation and
usually arise from operator-initiated actions such as a DPO (Dynamic
Platform Optimizer) run.

Eventually we do want to consume these events and update the device
tree, but that needs more care to be safe vs LPM and DLPAR.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/kernel/rtasd.c | 28 +++-------------------------
 1 file changed, 3 insertions(+), 25 deletions(-)

diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index 89b798f8f656..8561dfb33f24 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -273,37 +273,15 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
 	}
 }
 
-#ifdef CONFIG_PPC_PSERIES
-static void handle_prrn_event(s32 scope)
-{
-	/*
-	 * For PRRN, we must pass the negative of the scope value in
-	 * the RTAS event.
-	 */
-	pseries_devicetree_update(-scope);
-	numa_update_cpu_topology(false);
-}
-
 static void handle_rtas_event(const struct rtas_error_log *log)
 {
-	if (rtas_error_type(log) != RTAS_TYPE_PRRN || !prrn_is_enabled())
+	if (!machine_is(pseries))
 		return;
 
-	/* For PRRN Events the extended log length is used to denote
-	 * the scope for calling rtas update-nodes.
-	 */
-	handle_prrn_event(rtas_error_extended_log_length(log));
+	if (rtas_error_type(log) == RTAS_TYPE_PRRN)
+		pr_info_ratelimited("Platform resource reassignment ignored.\n");
 }
 
-#else
-
-static void handle_rtas_event(const struct rtas_error_log *log)
-{
-	return;
-}
-
-#endif
-
 static int rtas_log_open(struct inode * inode, struct file * file)
 {
 	return 0;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 13/18] powerpc/numa: remove prrn_is_enabled()
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (11 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:31   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 14/18] powerpc/numa: remove arch_update_cpu_topology Nathan Lynch
                   ` (5 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

All users of this prrn_is_enabled() are gone; remove it.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/include/asm/topology.h | 5 -----
 arch/powerpc/mm/numa.c              | 5 -----
 2 files changed, 10 deletions(-)

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 537c638582eb..658aad65912b 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -93,13 +93,8 @@ static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
 #endif /* CONFIG_NUMA */
 
 #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
-extern int prrn_is_enabled(void);
 extern int find_and_online_cpu_nid(int cpu);
 #else
-static inline int prrn_is_enabled(void)
-{
-	return 0;
-}
 static inline int find_and_online_cpu_nid(int cpu)
 {
 	return 0;
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index dec7ce3b5e67..26fcc947dd2d 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1210,11 +1210,6 @@ int arch_update_cpu_topology(void)
 	return numa_update_cpu_topology(true);
 }
 
-int prrn_is_enabled(void)
-{
-	return 0;
-}
-
 static int topology_update_init(void)
 {
 	topology_inited = 1;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 14/18] powerpc/numa: remove arch_update_cpu_topology
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (12 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 13/18] powerpc/numa: remove prrn_is_enabled() Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-23 16:32   ` Srikar Dronamraju
  2020-06-12  5:12 ` [PATCH 15/18] powerpc/pseries: remove prrn special case from DT update path Nathan Lynch
                   ` (4 subsequent siblings)
  18 siblings, 1 reply; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

Since arch_update_cpu_topology() doesn't do anything on powerpc now,
remove it and associated dead code.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/include/asm/topology.h |  6 ------
 arch/powerpc/mm/numa.c              | 10 ----------
 2 files changed, 16 deletions(-)

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 658aad65912b..b2c346c5e16f 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -43,7 +43,6 @@ extern void __init dump_numa_cpu_topology(void);
 
 extern int sysfs_add_device_to_node(struct device *dev, int nid);
 extern void sysfs_remove_device_from_node(struct device *dev, int nid);
-extern int numa_update_cpu_topology(bool cpus_locked);
 
 static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node)
 {
@@ -78,11 +77,6 @@ static inline void sysfs_remove_device_from_node(struct device *dev,
 {
 }
 
-static inline int numa_update_cpu_topology(bool cpus_locked)
-{
-	return 0;
-}
-
 static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
 
 static inline int cpu_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 26fcc947dd2d..e437a9ac4956 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1200,16 +1200,6 @@ int find_and_online_cpu_nid(int cpu)
 	return new_nid;
 }
 
-int numa_update_cpu_topology(bool cpus_locked)
-{
-	return 0;
-}
-
-int arch_update_cpu_topology(void)
-{
-	return numa_update_cpu_topology(true);
-}
-
 static int topology_update_init(void)
 {
 	topology_inited = 1;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 15/18] powerpc/pseries: remove prrn special case from DT update path
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (13 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 14/18] powerpc/numa: remove arch_update_cpu_topology Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-12  5:12 ` [PATCH 16/18] powerpc/pseries: remove memory "re-add" implementation Nathan Lynch
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

pseries_devicetree_update() is no longer called with PRRN_SCOPE. The
purpose of prrn_update_node() was to remove and then add back a LMB
whose NUMA assignment had changed. This has never been reliable, and
this codepath has been default-disabled for several releases. Remove
prrn_update_node().

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/mobility.c | 27 -----------------------
 1 file changed, 27 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index c0b09f6f0ae3..78cd772a579b 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -244,29 +244,6 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
 	return rc;
 }
 
-static void prrn_update_node(__be32 phandle)
-{
-	struct pseries_hp_errorlog hp_elog;
-	struct device_node *dn;
-
-	/*
-	 * If a node is found from a the given phandle, the phandle does not
-	 * represent the drc index of an LMB and we can ignore.
-	 */
-	dn = of_find_node_by_phandle(be32_to_cpu(phandle));
-	if (dn) {
-		of_node_put(dn);
-		return;
-	}
-
-	hp_elog.resource = PSERIES_HP_ELOG_RESOURCE_MEM;
-	hp_elog.action = PSERIES_HP_ELOG_ACTION_READD;
-	hp_elog.id_type = PSERIES_HP_ELOG_ID_DRC_INDEX;
-	hp_elog._drc_u.drc_index = phandle;
-
-	handle_dlpar_errorlog(&hp_elog);
-}
-
 int pseries_devicetree_update(s32 scope)
 {
 	char *rtas_buf;
@@ -305,10 +282,6 @@ int pseries_devicetree_update(s32 scope)
 					break;
 				case UPDATE_DT_NODE:
 					update_dt_node(phandle, scope);
-
-					if (scope == PRRN_SCOPE)
-						prrn_update_node(phandle);
-
 					break;
 				case ADD_DT_NODE:
 					drc_index = *data++;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 16/18] powerpc/pseries: remove memory "re-add" implementation
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (14 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 15/18] powerpc/pseries: remove prrn special case from DT update path Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-12  5:12 ` [PATCH 17/18] powerpc/pseries: remove dlpar_cpu_readd() Nathan Lynch
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

dlpar_memory() no longer has any callers which pass
PSERIES_HP_ELOG_ACTION_READD. Remove this case and the corresponding
unreachable code.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/include/asm/rtas.h               |  1 -
 .../platforms/pseries/hotplug-memory.c        | 42 -------------------
 2 files changed, 43 deletions(-)

diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 0107d724e9da..55f9a154c95d 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -215,7 +215,6 @@ inline uint16_t pseries_errorlog_length(struct pseries_errorlog *sect)
 
 #define PSERIES_HP_ELOG_ACTION_ADD	1
 #define PSERIES_HP_ELOG_ACTION_REMOVE	2
-#define PSERIES_HP_ELOG_ACTION_READD	3
 
 #define PSERIES_HP_ELOG_ID_DRC_NAME	1
 #define PSERIES_HP_ELOG_ID_DRC_INDEX	2
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 5ace2f9a277e..67ece3ac9ac2 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -487,40 +487,6 @@ static int dlpar_memory_remove_by_index(u32 drc_index)
 	return rc;
 }
 
-static int dlpar_memory_readd_by_index(u32 drc_index)
-{
-	struct drmem_lmb *lmb;
-	int lmb_found;
-	int rc;
-
-	pr_info("Attempting to update LMB, drc index %x\n", drc_index);
-
-	lmb_found = 0;
-	for_each_drmem_lmb(lmb) {
-		if (lmb->drc_index == drc_index) {
-			lmb_found = 1;
-			rc = dlpar_remove_lmb(lmb);
-			if (!rc) {
-				rc = dlpar_add_lmb(lmb);
-				if (rc)
-					dlpar_release_drc(lmb->drc_index);
-			}
-			break;
-		}
-	}
-
-	if (!lmb_found)
-		rc = -EINVAL;
-
-	if (rc)
-		pr_info("Failed to update memory at %llx\n",
-			lmb->base_addr);
-	else
-		pr_info("Memory at %llx was updated\n", lmb->base_addr);
-
-	return rc;
-}
-
 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
 {
 	struct drmem_lmb *lmb, *start_lmb, *end_lmb;
@@ -617,10 +583,6 @@ static int dlpar_memory_remove_by_index(u32 drc_index)
 {
 	return -EOPNOTSUPP;
 }
-static int dlpar_memory_readd_by_index(u32 drc_index)
-{
-	return -EOPNOTSUPP;
-}
 
 static int dlpar_memory_remove_by_ic(u32 lmbs_to_remove, u32 drc_index)
 {
@@ -902,10 +864,6 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
 			break;
 		}
 
-		break;
-	case PSERIES_HP_ELOG_ACTION_READD:
-		drc_index = hp_elog->_drc_u.drc_index;
-		rc = dlpar_memory_readd_by_index(drc_index);
 		break;
 	default:
 		pr_err("Invalid action (%d) specified\n", hp_elog->action);
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 17/18] powerpc/pseries: remove dlpar_cpu_readd()
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (15 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 16/18] powerpc/pseries: remove memory "re-add" implementation Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-06-12  5:12 ` [PATCH 18/18] powerpc/pseries: remove obsolete memory hotplug DT notifier code Nathan Lynch
  2020-07-16 12:56 ` [PATCH 00/18] remove extended cede offline mode and bogus topology update code Michael Ellerman
  18 siblings, 0 replies; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

dlpar_cpu_readd() is unused now.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/include/asm/topology.h          |  1 -
 arch/powerpc/platforms/pseries/hotplug-cpu.c | 19 -------------------
 2 files changed, 20 deletions(-)

diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index b2c346c5e16f..f0b6300e7dd3 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -115,7 +115,6 @@ int get_physical_package_id(int cpu);
 #define topology_core_cpumask(cpu)	(per_cpu(cpu_core_map, cpu))
 #define topology_core_id(cpu)		(cpu_to_core_id(cpu))
 
-int dlpar_cpu_readd(int cpu);
 #endif
 #endif
 
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index dbfabb185eb5..4bad7a83addc 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -779,25 +779,6 @@ static int dlpar_cpu_add_by_count(u32 cpus_to_add)
 	return rc;
 }
 
-int dlpar_cpu_readd(int cpu)
-{
-	struct device_node *dn;
-	struct device *dev;
-	u32 drc_index;
-	int rc;
-
-	dev = get_cpu_device(cpu);
-	dn = dev->of_node;
-
-	rc = of_property_read_u32(dn, "ibm,my-drc-index", &drc_index);
-
-	rc = dlpar_cpu_remove_by_index(drc_index);
-	if (!rc)
-		rc = dlpar_cpu_add(drc_index);
-
-	return rc;
-}
-
 int dlpar_cpu(struct pseries_hp_errorlog *hp_elog)
 {
 	u32 count, drc_index;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 18/18] powerpc/pseries: remove obsolete memory hotplug DT notifier code
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (16 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 17/18] powerpc/pseries: remove dlpar_cpu_readd() Nathan Lynch
@ 2020-06-12  5:12 ` Nathan Lynch
  2020-07-16 12:56 ` [PATCH 00/18] remove extended cede offline mode and bogus topology update code Michael Ellerman
  18 siblings, 0 replies; 32+ messages in thread
From: Nathan Lynch @ 2020-06-12  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: tyreld, srikar, ego, npiggin, svaidy

pseries_update_drconf_memory() runs from a DT notifier in response to
an update to the ibm,dynamic-memory property of the
/ibm,dynamic-reconfiguration-memory node. This property is an older
less compact format than the ibm,dynamic-memory-v2 property used in
most currently supported firmwares. There has never been an equivalent
function for the v2 property.

pseries_update_drconf_memory() compares the 'assigned' flag for each
LMB in the old vs new properties and adds or removes the block
accordingly. However it appears to be of no actual utility:

* Partition suspension and PRRNs are specified only to change LMBs'
  NUMA affinity information. This notifier should be a no-op for those
  scenarios since the assigned flags should not change.

* The memory hotplug/DLPAR path has a hack which short-circuits
  execution of the notifier:
     dlpar_memory()
        ...
        rtas_hp_event = true;
        drmem_update_dt()
           of_update_property()
              pseries_memory_notifier()
                 pseries_update_drconf_memory()
                    if (rtas_hp_event) return;

So this code only makes sense as a relic of the time when more of the
DLPAR workflow took place in user space. I don't see a purpose for it
now.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 .../platforms/pseries/hotplug-memory.c        | 65 +------------------
 1 file changed, 1 insertion(+), 64 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 67ece3ac9ac2..73a5dcd977e1 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -22,8 +22,6 @@
 #include <asm/drmem.h>
 #include "pseries.h"
 
-static bool rtas_hp_event;
-
 unsigned long pseries_memory_block_size(void)
 {
 	struct device_node *np;
@@ -871,11 +869,8 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
 		break;
 	}
 
-	if (!rc) {
-		rtas_hp_event = true;
+	if (!rc)
 		rc = drmem_update_dt();
-		rtas_hp_event = false;
-	}
 
 	unlock_device_hotplug();
 	return rc;
@@ -911,60 +906,6 @@ static int pseries_add_mem_node(struct device_node *np)
 	return (ret < 0) ? -EINVAL : 0;
 }
 
-static int pseries_update_drconf_memory(struct of_reconfig_data *pr)
-{
-	struct of_drconf_cell_v1 *new_drmem, *old_drmem;
-	unsigned long memblock_size;
-	u32 entries;
-	__be32 *p;
-	int i, rc = -EINVAL;
-
-	if (rtas_hp_event)
-		return 0;
-
-	memblock_size = pseries_memory_block_size();
-	if (!memblock_size)
-		return -EINVAL;
-
-	if (!pr->old_prop)
-		return 0;
-
-	p = (__be32 *) pr->old_prop->value;
-	if (!p)
-		return -EINVAL;
-
-	/* The first int of the property is the number of lmb's described
-	 * by the property. This is followed by an array of of_drconf_cell
-	 * entries. Get the number of entries and skip to the array of
-	 * of_drconf_cell's.
-	 */
-	entries = be32_to_cpu(*p++);
-	old_drmem = (struct of_drconf_cell_v1 *)p;
-
-	p = (__be32 *)pr->prop->value;
-	p++;
-	new_drmem = (struct of_drconf_cell_v1 *)p;
-
-	for (i = 0; i < entries; i++) {
-		if ((be32_to_cpu(old_drmem[i].flags) & DRCONF_MEM_ASSIGNED) &&
-		    (!(be32_to_cpu(new_drmem[i].flags) & DRCONF_MEM_ASSIGNED))) {
-			rc = pseries_remove_memblock(
-				be64_to_cpu(old_drmem[i].base_addr),
-						     memblock_size);
-			break;
-		} else if ((!(be32_to_cpu(old_drmem[i].flags) &
-			    DRCONF_MEM_ASSIGNED)) &&
-			    (be32_to_cpu(new_drmem[i].flags) &
-			    DRCONF_MEM_ASSIGNED)) {
-			rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr),
-					  memblock_size);
-			rc = (rc < 0) ? -EINVAL : 0;
-			break;
-		}
-	}
-	return rc;
-}
-
 static int pseries_memory_notifier(struct notifier_block *nb,
 				   unsigned long action, void *data)
 {
@@ -978,10 +919,6 @@ static int pseries_memory_notifier(struct notifier_block *nb,
 	case OF_RECONFIG_DETACH_NODE:
 		err = pseries_remove_mem_node(rd->dn);
 		break;
-	case OF_RECONFIG_UPDATE_PROPERTY:
-		if (!strcmp(rd->prop->name, "ibm,dynamic-memory"))
-			err = pseries_update_drconf_memory(rd);
-		break;
 	}
 	return notifier_from_errno(err);
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH 03/18] powerpc/numa: remove ability to enable topology updates
  2020-06-12  5:12 ` [PATCH 03/18] powerpc/numa: remove ability to enable topology updates Nathan Lynch
@ 2020-06-23 16:23   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:23 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:23]:

> Remove the /proc/powerpc/topology_updates interface and the
> topology_updates=on/off command line argument. The internal
> topology_updates_enabled flag remains for now, but always false.
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/mm/numa.c | 71 +-----------------------------------------
>  1 file changed, 1 insertion(+), 70 deletions(-)
> 
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index 9fcf2d195830..34d95de77bdd 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -984,27 +984,7 @@ static int __init early_numa(char *p)
>  }
>  early_param("numa", early_numa);
> 
> -/*
> - * The platform can inform us through one of several mechanisms
> - * (post-migration device tree updates, PRRN or VPHN) that the NUMA
> - * assignment of a resource has changed. This controls whether we act
> - * on that. Disabled by default.
> - */
> -static bool topology_updates_enabled;
> -
> -static int __init early_topology_updates(char *p)
> -{
> -	if (!p)
> -		return 0;
> -
> -	if (!strcmp(p, "on")) {
> -		pr_warn("Caution: enabling topology updates\n");
> -		topology_updates_enabled = true;
> -	}
> -
> -	return 0;
> -}
> -early_param("topology_updates", early_topology_updates);
> +static const bool topology_updates_enabled;
> 
>  #ifdef CONFIG_MEMORY_HOTPLUG
>  /*
> @@ -1632,52 +1612,6 @@ int prrn_is_enabled(void)
>  	return prrn_enabled;
>  }
> 
> -static int topology_read(struct seq_file *file, void *v)
> -{
> -	if (vphn_enabled || prrn_enabled)
> -		seq_puts(file, "on\n");
> -	else
> -		seq_puts(file, "off\n");
> -
> -	return 0;
> -}
> -
> -static int topology_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, topology_read, NULL);
> -}
> -
> -static ssize_t topology_write(struct file *file, const char __user *buf,
> -			      size_t count, loff_t *off)
> -{
> -	char kbuf[4]; /* "on" or "off" plus null. */
> -	int read_len;
> -
> -	read_len = count < 3 ? count : 3;
> -	if (copy_from_user(kbuf, buf, read_len))
> -		return -EINVAL;
> -
> -	kbuf[read_len] = '\0';
> -
> -	if (!strncmp(kbuf, "on", 2)) {
> -		topology_updates_enabled = true;
> -		start_topology_update();
> -	} else if (!strncmp(kbuf, "off", 3)) {
> -		stop_topology_update();
> -		topology_updates_enabled = false;
> -	} else
> -		return -EINVAL;
> -
> -	return count;
> -}
> -
> -static const struct proc_ops topology_proc_ops = {
> -	.proc_read	= seq_read,
> -	.proc_write	= topology_write,
> -	.proc_open	= topology_open,
> -	.proc_release	= single_release,
> -};
> -
>  static int topology_update_init(void)
>  {
>  	start_topology_update();
> @@ -1685,9 +1619,6 @@ static int topology_update_init(void)
>  	if (vphn_enabled)
>  		topology_schedule_update();
> 
> -	if (!proc_create("powerpc/topology_updates", 0644, NULL, &topology_proc_ops))
> -		return -ENOMEM;
> -
>  	topology_inited = 1;
>  	return 0;
>  }
> -- 
> 2.25.4
> 

-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 04/18] powerpc/numa: remove unreachable topology update code
  2020-06-12  5:12 ` [PATCH 04/18] powerpc/numa: remove unreachable topology update code Nathan Lynch
@ 2020-06-23 16:24   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:24 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:24]:

> Since the topology_updates_enabled flag is now always false, remove it
> and the code which has become unreachable. This is the minimum change
> that prevents 'defined but unused' warnings emitted by the compiler
> after stubbing out the start/stop_topology_updates() functions.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const
  2020-06-12  5:12 ` [PATCH 05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const Nathan Lynch
@ 2020-06-23 16:24   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:24 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:25]:

> Previous changes have made it so these flags are never changed;
> enforce this by making them const.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>

>  arch/powerpc/mm/numa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index 9e20f12e6caf..1b89bacb8975 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -1132,8 +1132,8 @@ struct topology_update_data {
>  #define TOPOLOGY_DEF_TIMER_SECS	60
> 
>  static cpumask_t cpu_associativity_changes_mask;
> -static int vphn_enabled;
> -static int prrn_enabled;
> +static const int vphn_enabled;
> +static const int prrn_enabled;
>  static void reset_topology_timer(void);
>  static int topology_timer_secs = 1;
>  static int topology_inited;
> -- 
> 2.25.4
> 

-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 06/18] powerpc/numa: remove unreachable topology timer code
  2020-06-12  5:12 ` [PATCH 06/18] powerpc/numa: remove unreachable topology timer code Nathan Lynch
@ 2020-06-23 16:25   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:25 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:26]:

> Since vphn_enabled is always 0, we can stub out
> timed_topology_update() and remove the code which becomes unreachable.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/mm/numa.c | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 07/18] powerpc/numa: remove unreachable topology workqueue code
  2020-06-12  5:12 ` [PATCH 07/18] powerpc/numa: remove unreachable topology workqueue code Nathan Lynch
@ 2020-06-23 16:26   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:26 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:27]:

> Since vphn_enabled is always 0, we can remove the call to
> topology_schedule_update() and remove the code which becomes
> unreachable as a result.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/mm/numa.c | 14 --------------
>  1 file changed, 14 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags
  2020-06-12  5:12 ` [PATCH 08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags Nathan Lynch
@ 2020-06-23 16:27   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:27 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:28]:

> These flags are always zero now; remove them and suitably adjust the
> remaining references to them.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/mm/numa.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 09/18] powerpc/numa: stub out numa_update_cpu_topology()
  2020-06-12  5:12 ` [PATCH 09/18] powerpc/numa: stub out numa_update_cpu_topology() Nathan Lynch
@ 2020-06-23 16:27   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:27 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:29]:

> Previous changes have removed the code which sets bits in
> cpu_associativity_changes_mask and thus it is never modifed at
> runtime. From this we can reason that numa_update_cpu_topology()
> always returns 0 without doing anything. Remove the body of
> numa_update_cpu_topology() and remove all code which becomes
> unreachable as a result.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/mm/numa.c | 193 +----------------------------------------
>  1 file changed, 1 insertion(+), 192 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 10/18] powerpc/numa: remove timed_topology_update()
  2020-06-12  5:12 ` [PATCH 10/18] powerpc/numa: remove timed_topology_update() Nathan Lynch
@ 2020-06-23 16:28   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:28 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:30]:

> timed_topology_update is a no-op now, so remove it and all call sites.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/include/asm/topology.h          | 5 -----
>  arch/powerpc/mm/numa.c                       | 9 ---------
>  arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 --
>  3 files changed, 16 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 11/18] powerpc/numa: remove start/stop_topology_update()
  2020-06-12  5:12 ` [PATCH 11/18] powerpc/numa: remove start/stop_topology_update() Nathan Lynch
@ 2020-06-23 16:28   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:28 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:31]:

> These APIs have become no-ops, so remove them and all call sites.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events
  2020-06-12  5:12 ` [PATCH 12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events Nathan Lynch
@ 2020-06-23 16:30   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:30 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:32]:

> prrn_is_enabled() always returns false/0, so handle_rtas_event() can
> be simplified and some dead code can be removed. Use machine_is()
> instead of #ifdef to run this code only on pseries, and add an
> informational ratelimited message that we are ignoring the
> events. PRRN events are relatively rare in normal operation and
> usually arise from operator-initiated actions such as a DPO (Dynamic
> Platform Optimizer) run.
> 
> Eventually we do want to consume these events and update the device
> tree, but that needs more care to be safe vs LPM and DLPAR.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/kernel/rtasd.c | 28 +++-------------------------
>  1 file changed, 3 insertions(+), 25 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 13/18] powerpc/numa: remove prrn_is_enabled()
  2020-06-12  5:12 ` [PATCH 13/18] powerpc/numa: remove prrn_is_enabled() Nathan Lynch
@ 2020-06-23 16:31   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:31 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:33]:

> All users of this prrn_is_enabled() are gone; remove it.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/include/asm/topology.h | 5 -----
>  arch/powerpc/mm/numa.c              | 5 -----
>  2 files changed, 10 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 14/18] powerpc/numa: remove arch_update_cpu_topology
  2020-06-12  5:12 ` [PATCH 14/18] powerpc/numa: remove arch_update_cpu_topology Nathan Lynch
@ 2020-06-23 16:32   ` Srikar Dronamraju
  0 siblings, 0 replies; 32+ messages in thread
From: Srikar Dronamraju @ 2020-06-23 16:32 UTC (permalink / raw)
  To: Nathan Lynch; +Cc: tyreld, ego, npiggin, svaidy, linuxppc-dev

* Nathan Lynch <nathanl@linux.ibm.com> [2020-06-12 00:12:34]:

> Since arch_update_cpu_topology() doesn't do anything on powerpc now,
> remove it and associated dead code.
> 
> Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
> ---
>  arch/powerpc/include/asm/topology.h |  6 ------
>  arch/powerpc/mm/numa.c              | 10 ----------
>  2 files changed, 16 deletions(-)
> 

Looks good to me.

Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
-- 
Thanks and Regards
Srikar Dronamraju

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 00/18] remove extended cede offline mode and bogus topology update code
  2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
                   ` (17 preceding siblings ...)
  2020-06-12  5:12 ` [PATCH 18/18] powerpc/pseries: remove obsolete memory hotplug DT notifier code Nathan Lynch
@ 2020-07-16 12:56 ` Michael Ellerman
  18 siblings, 0 replies; 32+ messages in thread
From: Michael Ellerman @ 2020-07-16 12:56 UTC (permalink / raw)
  To: Nathan Lynch, linuxppc-dev; +Cc: ego, svaidy, srikar, npiggin, tyreld

On Fri, 12 Jun 2020 00:12:20 -0500, Nathan Lynch wrote:
> Two major parts to this series:
> 
> 1. Removal of the extended cede offline mode for CPUs as well as the
>    partition suspend code which accommodates it by temporarily
>    onlining all CPUs prior to suspending the LPAR. This solves some
>    accounting problems, simplifies the pseries CPU hotplug code, and
>    greatly uncomplicates the existing partition suspend code, easing
>    a much-needed transition to the Linux suspend framework. The two
>    patches which make up this part have been posted before:
> 
> [...]

Applied to powerpc/next.

[01/18] powerpc/pseries: remove cede offline state for CPUs
        https://git.kernel.org/powerpc/c/48f6e7f6d948b56489da027bc3284c709b939d28
[02/18] powerpc/rtas: don't online CPUs for partition suspend
        https://git.kernel.org/powerpc/c/ec2fc2a9e9bbad9023aab65bc472ce7a3ca8608f
[03/18] powerpc/numa: remove ability to enable topology updates
        https://git.kernel.org/powerpc/c/c30f931e891eb0a32885ecd79984e1e7366fceda
[04/18] powerpc/numa: remove unreachable topology update code
        https://git.kernel.org/powerpc/c/7d35bef96a46f7e9e167bb25258c0bd389aeab1b
[05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const
        https://git.kernel.org/powerpc/c/e6eacf8eb4dee7bc7021c837666e3ebf1b0ec3b5
[06/18] powerpc/numa: remove unreachable topology timer code
        https://git.kernel.org/powerpc/c/50e0cf3742a01e72f4ea4a8fe9221b152e22871b
[07/18] powerpc/numa: remove unreachable topology workqueue code
        https://git.kernel.org/powerpc/c/6325cb4a4ea8f4af8515b923650dd8f709694b44
[08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags
        https://git.kernel.org/powerpc/c/9fb8b5fd1bf782a8257506ad5198237f4124d556
[09/18] powerpc/numa: stub out numa_update_cpu_topology()
        https://git.kernel.org/powerpc/c/893ec6461f46c91487d914e6d467d2e804b9a883
[10/18] powerpc/numa: remove timed_topology_update()
        https://git.kernel.org/powerpc/c/b1815aeac7fde2dc3412daf2efaededd21cd58e0
[11/18] powerpc/numa: remove start/stop_topology_update()
        https://git.kernel.org/powerpc/c/1835303e5690cbeef2c07a9a5416045475ddaa13
[12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events
        https://git.kernel.org/powerpc/c/91713ac377859893a7798999cb2e3a388d8ae710
[13/18] powerpc/numa: remove prrn_is_enabled()
        https://git.kernel.org/powerpc/c/042ef7cc43f4571d8cbe44a7c735ab6622809142
[14/18] powerpc/numa: remove arch_update_cpu_topology
        https://git.kernel.org/powerpc/c/cdf082c4570f186d608aca688f2cc872b014558a
[15/18] powerpc/pseries: remove prrn special case from DT update path
        https://git.kernel.org/powerpc/c/bb7c3d36e3b18aa02d34358ae75e1b91f69a968b
[16/18] powerpc/pseries: remove memory "re-add" implementation
        https://git.kernel.org/powerpc/c/4abe60c6448bf1dba48689450ad1348e5fc6f7b7
[17/18] powerpc/pseries: remove dlpar_cpu_readd()
        https://git.kernel.org/powerpc/c/38c392cef19019457ddcfb197ff3d9c5267698e6
[18/18] powerpc/pseries: remove obsolete memory hotplug DT notifier code
        https://git.kernel.org/powerpc/c/e978a3ccaa714b5ff125857d2cbecbb6fdf6c094

cheers

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2020-07-16 14:07 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12  5:12 [PATCH 00/18] remove extended cede offline mode and bogus topology update code Nathan Lynch
2020-06-12  5:12 ` [PATCH 01/18] powerpc/pseries: remove cede offline state for CPUs Nathan Lynch
2020-06-12  5:12 ` [PATCH 02/18] powerpc/rtas: don't online CPUs for partition suspend Nathan Lynch
2020-06-12  5:12 ` [PATCH 03/18] powerpc/numa: remove ability to enable topology updates Nathan Lynch
2020-06-23 16:23   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 04/18] powerpc/numa: remove unreachable topology update code Nathan Lynch
2020-06-23 16:24   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 05/18] powerpc/numa: make vphn_enabled, prrn_enabled flags const Nathan Lynch
2020-06-23 16:24   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 06/18] powerpc/numa: remove unreachable topology timer code Nathan Lynch
2020-06-23 16:25   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 07/18] powerpc/numa: remove unreachable topology workqueue code Nathan Lynch
2020-06-23 16:26   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 08/18] powerpc/numa: remove vphn_enabled and prrn_enabled internal flags Nathan Lynch
2020-06-23 16:27   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 09/18] powerpc/numa: stub out numa_update_cpu_topology() Nathan Lynch
2020-06-23 16:27   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 10/18] powerpc/numa: remove timed_topology_update() Nathan Lynch
2020-06-23 16:28   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 11/18] powerpc/numa: remove start/stop_topology_update() Nathan Lynch
2020-06-23 16:28   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 12/18] powerpc/rtasd: simplify handle_rtas_event(), emit message on events Nathan Lynch
2020-06-23 16:30   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 13/18] powerpc/numa: remove prrn_is_enabled() Nathan Lynch
2020-06-23 16:31   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 14/18] powerpc/numa: remove arch_update_cpu_topology Nathan Lynch
2020-06-23 16:32   ` Srikar Dronamraju
2020-06-12  5:12 ` [PATCH 15/18] powerpc/pseries: remove prrn special case from DT update path Nathan Lynch
2020-06-12  5:12 ` [PATCH 16/18] powerpc/pseries: remove memory "re-add" implementation Nathan Lynch
2020-06-12  5:12 ` [PATCH 17/18] powerpc/pseries: remove dlpar_cpu_readd() Nathan Lynch
2020-06-12  5:12 ` [PATCH 18/18] powerpc/pseries: remove obsolete memory hotplug DT notifier code Nathan Lynch
2020-07-16 12:56 ` [PATCH 00/18] remove extended cede offline mode and bogus topology update code Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).