* [PATCH 1/2] rcu: declare rcu_eqs_special_set() in public header
From: Yury Norov @ 2018-03-25 17:50 UTC (permalink / raw)
To: Paul E. McKenney, Chris Metcalf, Christopher Lameter,
Russell King - ARM Linux, Mark Rutland, Steven Rostedt,
Mathieu Desnoyers, Catalin Marinas, Will Deacon, Pekka Enberg,
David Rientjes, Joonsoo Kim, Andrew Morton,
Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: Yury Norov, linux-arm-kernel, linuxppc-dev, kvm-ppc, linux-mm,
linux-kernel
In-Reply-To: <20180325175004.28162-1-ynorov@caviumnetworks.com>
rcu_eqs_special_set() is declared only in internal header
kernel/rcu/tree.h and stubbed in include/linux/rcutiny.h.
This patch declares rcu_eqs_special_set() in include/linux/rcutree.h, so
it can be used in non-rcu kernel code.
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
include/linux/rcutree.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index fd996cdf1833..448f20f27396 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -74,6 +74,7 @@ static inline void synchronize_rcu_bh_expedited(void)
void rcu_barrier(void);
void rcu_barrier_bh(void);
void rcu_barrier_sched(void);
+bool rcu_eqs_special_set(int cpu);
unsigned long get_state_synchronize_rcu(void);
void cond_synchronize_rcu(unsigned long oldstate);
unsigned long get_state_synchronize_sched(void);
--
2.14.1
^ permalink raw reply related
* [PATCH 2/2] smp: introduce kick_active_cpus_sync()
From: Yury Norov @ 2018-03-25 17:50 UTC (permalink / raw)
To: Paul E. McKenney, Chris Metcalf, Christopher Lameter,
Russell King - ARM Linux, Mark Rutland, Steven Rostedt,
Mathieu Desnoyers, Catalin Marinas, Will Deacon, Pekka Enberg,
David Rientjes, Joonsoo Kim, Andrew Morton,
Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
Cc: Yury Norov, linux-arm-kernel, linuxppc-dev, kvm-ppc, linux-mm,
linux-kernel
In-Reply-To: <20180325175004.28162-1-ynorov@caviumnetworks.com>
kick_all_cpus_sync() forces all CPUs to sync caches by sending broadcast IPI.
If CPU is in extended quiescent state (idle task or nohz_full userspace), this
work may be done at the exit of this state. Delaying synchronization helps to
save power if CPU is in idle state and decrease latency for real-time tasks.
This patch introduces kick_active_cpus_sync() and uses it in mm/slab and arm64
code to delay syncronization.
For task isolation (https://lkml.org/lkml/2017/11/3/589), IPI to the CPU running
isolated task would be fatal, as it breaks isolation. The approach with delaying
of synchronization work helps to maintain isolated state.
I've tested it with test from task isolation series on ThunderX2 for more than
10 hours (10k giga-ticks) without breaking isolation.
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
---
arch/arm64/kernel/insn.c | 2 +-
include/linux/smp.h | 2 ++
kernel/smp.c | 24 ++++++++++++++++++++++++
mm/slab.c | 2 +-
4 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c
index 2718a77da165..9d7c492e920e 100644
--- a/arch/arm64/kernel/insn.c
+++ b/arch/arm64/kernel/insn.c
@@ -291,7 +291,7 @@ int __kprobes aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt)
* synchronization.
*/
ret = aarch64_insn_patch_text_nosync(addrs[0], insns[0]);
- kick_all_cpus_sync();
+ kick_active_cpus_sync();
return ret;
}
}
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 9fb239e12b82..27215e22240d 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -105,6 +105,7 @@ int smp_call_function_any(const struct cpumask *mask,
smp_call_func_t func, void *info, int wait);
void kick_all_cpus_sync(void);
+void kick_active_cpus_sync(void);
void wake_up_all_idle_cpus(void);
/*
@@ -161,6 +162,7 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
}
static inline void kick_all_cpus_sync(void) { }
+static inline void kick_active_cpus_sync(void) { }
static inline void wake_up_all_idle_cpus(void) { }
#ifdef CONFIG_UP_LATE_INIT
diff --git a/kernel/smp.c b/kernel/smp.c
index 084c8b3a2681..0358d6673850 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -724,6 +724,30 @@ void kick_all_cpus_sync(void)
}
EXPORT_SYMBOL_GPL(kick_all_cpus_sync);
+/**
+ * kick_active_cpus_sync - Force CPUs that are not in extended
+ * quiescent state (idle or nohz_full userspace) sync by sending
+ * IPI. Extended quiescent state CPUs will sync at the exit of
+ * that state.
+ */
+void kick_active_cpus_sync(void)
+{
+ int cpu;
+ struct cpumask kernel_cpus;
+
+ smp_mb();
+
+ cpumask_clear(&kernel_cpus);
+ preempt_disable();
+ for_each_online_cpu(cpu) {
+ if (!rcu_eqs_special_set(cpu))
+ cpumask_set_cpu(cpu, &kernel_cpus);
+ }
+ smp_call_function_many(&kernel_cpus, do_nothing, NULL, 1);
+ preempt_enable();
+}
+EXPORT_SYMBOL_GPL(kick_active_cpus_sync);
+
/**
* wake_up_all_idle_cpus - break all cpus out of idle
* wake_up_all_idle_cpus try to break all cpus which is in idle state even
diff --git a/mm/slab.c b/mm/slab.c
index 324446621b3e..678d5dbd6f46 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3856,7 +3856,7 @@ static int __do_tune_cpucache(struct kmem_cache *cachep, int limit,
* cpus, so skip the IPIs.
*/
if (prev)
- kick_all_cpus_sync();
+ kick_active_cpus_sync();
check_irq_on();
cachep->batchcount = batchcount;
--
2.14.1
^ permalink raw reply related
* Re: [PATCH 1/2] rcu: declare rcu_eqs_special_set() in public header
From: Paul E. McKenney @ 2018-03-25 19:12 UTC (permalink / raw)
To: Yury Norov
Cc: Chris Metcalf, Christopher Lameter, Russell King - ARM Linux,
Mark Rutland, Steven Rostedt, Mathieu Desnoyers, Catalin Marinas,
Will Deacon, Pekka Enberg, David Rientjes, Joonsoo Kim,
Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, linux-arm-kernel, linuxppc-dev, kvm-ppc,
linux-mm, linux-kernel
In-Reply-To: <20180325175004.28162-2-ynorov@caviumnetworks.com>
On Sun, Mar 25, 2018 at 08:50:03PM +0300, Yury Norov wrote:
> rcu_eqs_special_set() is declared only in internal header
> kernel/rcu/tree.h and stubbed in include/linux/rcutiny.h.
>
> This patch declares rcu_eqs_special_set() in include/linux/rcutree.h, so
> it can be used in non-rcu kernel code.
>
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> ---
> include/linux/rcutree.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
> index fd996cdf1833..448f20f27396 100644
> --- a/include/linux/rcutree.h
> +++ b/include/linux/rcutree.h
> @@ -74,6 +74,7 @@ static inline void synchronize_rcu_bh_expedited(void)
> void rcu_barrier(void);
> void rcu_barrier_bh(void);
> void rcu_barrier_sched(void);
> +bool rcu_eqs_special_set(int cpu);
> unsigned long get_state_synchronize_rcu(void);
> void cond_synchronize_rcu(unsigned long oldstate);
> unsigned long get_state_synchronize_sched(void);
Good point, a bit hard to use otherwise. ;-)
I removed the declaration from rcutree.h and updated the commit log as
follows. Does it look OK?
Thanx, Paul
------------------------------------------------------------------------
commit 4497105b718a819072d48a675916d9d200b5327f
Author: Yury Norov <ynorov@caviumnetworks.com>
Date: Sun Mar 25 20:50:03 2018 +0300
rcu: Declare rcu_eqs_special_set() in public header
Because rcu_eqs_special_set() is declared only in internal header
kernel/rcu/tree.h and stubbed in include/linux/rcutiny.h, it is
inaccessible outside of the RCU implementation. This patch therefore
moves the rcu_eqs_special_set() declaration to include/linux/rcutree.h,
which allows it to be used in non-rcu kernel code.
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index fd996cdf1833..448f20f27396 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -74,6 +74,7 @@ static inline void synchronize_rcu_bh_expedited(void)
void rcu_barrier(void);
void rcu_barrier_bh(void);
void rcu_barrier_sched(void);
+bool rcu_eqs_special_set(int cpu);
unsigned long get_state_synchronize_rcu(void);
void cond_synchronize_rcu(unsigned long oldstate);
unsigned long get_state_synchronize_sched(void);
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 59ad0e23c722..d5f617aaa744 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -415,7 +415,6 @@ extern struct rcu_state rcu_preempt_state;
#endif /* #ifdef CONFIG_PREEMPT_RCU */
int rcu_dynticks_snap(struct rcu_dynticks *rdtp);
-bool rcu_eqs_special_set(int cpu);
#ifdef CONFIG_RCU_BOOST
DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_status);
^ permalink raw reply related
* Re: [PATCH 1/2] rcu: declare rcu_eqs_special_set() in public header
From: Yury Norov @ 2018-03-25 19:18 UTC (permalink / raw)
To: Paul E. McKenney
Cc: Chris Metcalf, Christopher Lameter, Russell King - ARM Linux,
Mark Rutland, Steven Rostedt, Mathieu Desnoyers, Catalin Marinas,
Will Deacon, Pekka Enberg, David Rientjes, Joonsoo Kim,
Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, linux-arm-kernel, linuxppc-dev, kvm-ppc,
linux-mm, linux-kernel
In-Reply-To: <20180325191243.GH3675@linux.vnet.ibm.com>
On Sun, Mar 25, 2018 at 12:12:43PM -0700, Paul E. McKenney wrote:
> On Sun, Mar 25, 2018 at 08:50:03PM +0300, Yury Norov wrote:
> > rcu_eqs_special_set() is declared only in internal header
> > kernel/rcu/tree.h and stubbed in include/linux/rcutiny.h.
> >
> > This patch declares rcu_eqs_special_set() in include/linux/rcutree.h, so
> > it can be used in non-rcu kernel code.
> >
> > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> > ---
> > include/linux/rcutree.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
> > index fd996cdf1833..448f20f27396 100644
> > --- a/include/linux/rcutree.h
> > +++ b/include/linux/rcutree.h
> > @@ -74,6 +74,7 @@ static inline void synchronize_rcu_bh_expedited(void)
> > void rcu_barrier(void);
> > void rcu_barrier_bh(void);
> > void rcu_barrier_sched(void);
> > +bool rcu_eqs_special_set(int cpu);
> > unsigned long get_state_synchronize_rcu(void);
> > void cond_synchronize_rcu(unsigned long oldstate);
> > unsigned long get_state_synchronize_sched(void);
>
> Good point, a bit hard to use otherwise. ;-)
>
> I removed the declaration from rcutree.h and updated the commit log as
> follows. Does it look OK?
Of course.
Thanks,
Yury
> ------------------------------------------------------------------------
>
> commit 4497105b718a819072d48a675916d9d200b5327f
> Author: Yury Norov <ynorov@caviumnetworks.com>
> Date: Sun Mar 25 20:50:03 2018 +0300
>
> rcu: Declare rcu_eqs_special_set() in public header
>
> Because rcu_eqs_special_set() is declared only in internal header
> kernel/rcu/tree.h and stubbed in include/linux/rcutiny.h, it is
> inaccessible outside of the RCU implementation. This patch therefore
> moves the rcu_eqs_special_set() declaration to include/linux/rcutree.h,
> which allows it to be used in non-rcu kernel code.
>
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
>
> diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
> index fd996cdf1833..448f20f27396 100644
> --- a/include/linux/rcutree.h
> +++ b/include/linux/rcutree.h
> @@ -74,6 +74,7 @@ static inline void synchronize_rcu_bh_expedited(void)
> void rcu_barrier(void);
> void rcu_barrier_bh(void);
> void rcu_barrier_sched(void);
> +bool rcu_eqs_special_set(int cpu);
> unsigned long get_state_synchronize_rcu(void);
> void cond_synchronize_rcu(unsigned long oldstate);
> unsigned long get_state_synchronize_sched(void);
> diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
> index 59ad0e23c722..d5f617aaa744 100644
> --- a/kernel/rcu/tree.h
> +++ b/kernel/rcu/tree.h
> @@ -415,7 +415,6 @@ extern struct rcu_state rcu_preempt_state;
> #endif /* #ifdef CONFIG_PREEMPT_RCU */
>
> int rcu_dynticks_snap(struct rcu_dynticks *rdtp);
> -bool rcu_eqs_special_set(int cpu);
>
> #ifdef CONFIG_RCU_BOOST
> DECLARE_PER_CPU(unsigned int, rcu_cpu_kthread_status);
^ permalink raw reply
* Re: [PATCH 2/2] smp: introduce kick_active_cpus_sync()
From: Paul E. McKenney @ 2018-03-25 19:23 UTC (permalink / raw)
To: Yury Norov
Cc: Chris Metcalf, Christopher Lameter, Russell King - ARM Linux,
Mark Rutland, Steven Rostedt, Mathieu Desnoyers, Catalin Marinas,
Will Deacon, Pekka Enberg, David Rientjes, Joonsoo Kim,
Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, linux-arm-kernel, linuxppc-dev, kvm-ppc,
linux-mm, linux-kernel, luto
In-Reply-To: <20180325175004.28162-3-ynorov@caviumnetworks.com>
On Sun, Mar 25, 2018 at 08:50:04PM +0300, Yury Norov wrote:
> kick_all_cpus_sync() forces all CPUs to sync caches by sending broadcast IPI.
> If CPU is in extended quiescent state (idle task or nohz_full userspace), this
> work may be done at the exit of this state. Delaying synchronization helps to
> save power if CPU is in idle state and decrease latency for real-time tasks.
>
> This patch introduces kick_active_cpus_sync() and uses it in mm/slab and arm64
> code to delay syncronization.
>
> For task isolation (https://lkml.org/lkml/2017/11/3/589), IPI to the CPU running
> isolated task would be fatal, as it breaks isolation. The approach with delaying
> of synchronization work helps to maintain isolated state.
>
> I've tested it with test from task isolation series on ThunderX2 for more than
> 10 hours (10k giga-ticks) without breaking isolation.
>
> Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> ---
> arch/arm64/kernel/insn.c | 2 +-
> include/linux/smp.h | 2 ++
> kernel/smp.c | 24 ++++++++++++++++++++++++
> mm/slab.c | 2 +-
> 4 files changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c
> index 2718a77da165..9d7c492e920e 100644
> --- a/arch/arm64/kernel/insn.c
> +++ b/arch/arm64/kernel/insn.c
> @@ -291,7 +291,7 @@ int __kprobes aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt)
> * synchronization.
> */
> ret = aarch64_insn_patch_text_nosync(addrs[0], insns[0]);
> - kick_all_cpus_sync();
> + kick_active_cpus_sync();
> return ret;
> }
> }
> diff --git a/include/linux/smp.h b/include/linux/smp.h
> index 9fb239e12b82..27215e22240d 100644
> --- a/include/linux/smp.h
> +++ b/include/linux/smp.h
> @@ -105,6 +105,7 @@ int smp_call_function_any(const struct cpumask *mask,
> smp_call_func_t func, void *info, int wait);
>
> void kick_all_cpus_sync(void);
> +void kick_active_cpus_sync(void);
> void wake_up_all_idle_cpus(void);
>
> /*
> @@ -161,6 +162,7 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
> }
>
> static inline void kick_all_cpus_sync(void) { }
> +static inline void kick_active_cpus_sync(void) { }
> static inline void wake_up_all_idle_cpus(void) { }
>
> #ifdef CONFIG_UP_LATE_INIT
> diff --git a/kernel/smp.c b/kernel/smp.c
> index 084c8b3a2681..0358d6673850 100644
> --- a/kernel/smp.c
> +++ b/kernel/smp.c
> @@ -724,6 +724,30 @@ void kick_all_cpus_sync(void)
> }
> EXPORT_SYMBOL_GPL(kick_all_cpus_sync);
>
> +/**
> + * kick_active_cpus_sync - Force CPUs that are not in extended
> + * quiescent state (idle or nohz_full userspace) sync by sending
> + * IPI. Extended quiescent state CPUs will sync at the exit of
> + * that state.
> + */
> +void kick_active_cpus_sync(void)
> +{
> + int cpu;
> + struct cpumask kernel_cpus;
> +
> + smp_mb();
> +
> + cpumask_clear(&kernel_cpus);
> + preempt_disable();
> + for_each_online_cpu(cpu) {
> + if (!rcu_eqs_special_set(cpu))
If we get here, the CPU is not in a quiescent state, so we therefore
must IPI it, correct?
But don't you also need to define rcu_eqs_special_exit() so that RCU
can invoke it when it next leaves its quiescent state? Or are you able
to ignore the CPU in that case? (If you are able to ignore the CPU in
that case, I could give you a lower-cost function to get your job done.)
Thanx, Paul
> + cpumask_set_cpu(cpu, &kernel_cpus);
> + }
> + smp_call_function_many(&kernel_cpus, do_nothing, NULL, 1);
> + preempt_enable();
> +}
> +EXPORT_SYMBOL_GPL(kick_active_cpus_sync);
> +
> /**
> * wake_up_all_idle_cpus - break all cpus out of idle
> * wake_up_all_idle_cpus try to break all cpus which is in idle state even
> diff --git a/mm/slab.c b/mm/slab.c
> index 324446621b3e..678d5dbd6f46 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3856,7 +3856,7 @@ static int __do_tune_cpucache(struct kmem_cache *cachep, int limit,
> * cpus, so skip the IPIs.
> */
> if (prev)
> - kick_all_cpus_sync();
> + kick_active_cpus_sync();
>
> check_irq_on();
> cachep->batchcount = batchcount;
> --
> 2.14.1
>
^ permalink raw reply
* Re: [PATCH 2/2] smp: introduce kick_active_cpus_sync()
From: Yury Norov @ 2018-03-25 20:11 UTC (permalink / raw)
To: Paul E. McKenney
Cc: Chris Metcalf, Christopher Lameter, Russell King - ARM Linux,
Mark Rutland, Steven Rostedt, Mathieu Desnoyers, Catalin Marinas,
Will Deacon, Pekka Enberg, David Rientjes, Joonsoo Kim,
Andrew Morton, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, linux-arm-kernel, linuxppc-dev, kvm-ppc,
linux-mm, linux-kernel, luto
In-Reply-To: <20180325192328.GI3675@linux.vnet.ibm.com>
On Sun, Mar 25, 2018 at 12:23:28PM -0700, Paul E. McKenney wrote:
> On Sun, Mar 25, 2018 at 08:50:04PM +0300, Yury Norov wrote:
> > kick_all_cpus_sync() forces all CPUs to sync caches by sending broadcast IPI.
> > If CPU is in extended quiescent state (idle task or nohz_full userspace), this
> > work may be done at the exit of this state. Delaying synchronization helps to
> > save power if CPU is in idle state and decrease latency for real-time tasks.
> >
> > This patch introduces kick_active_cpus_sync() and uses it in mm/slab and arm64
> > code to delay syncronization.
> >
> > For task isolation (https://lkml.org/lkml/2017/11/3/589), IPI to the CPU running
> > isolated task would be fatal, as it breaks isolation. The approach with delaying
> > of synchronization work helps to maintain isolated state.
> >
> > I've tested it with test from task isolation series on ThunderX2 for more than
> > 10 hours (10k giga-ticks) without breaking isolation.
> >
> > Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
> > ---
> > arch/arm64/kernel/insn.c | 2 +-
> > include/linux/smp.h | 2 ++
> > kernel/smp.c | 24 ++++++++++++++++++++++++
> > mm/slab.c | 2 +-
> > 4 files changed, 28 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c
> > index 2718a77da165..9d7c492e920e 100644
> > --- a/arch/arm64/kernel/insn.c
> > +++ b/arch/arm64/kernel/insn.c
> > @@ -291,7 +291,7 @@ int __kprobes aarch64_insn_patch_text(void *addrs[], u32 insns[], int cnt)
> > * synchronization.
> > */
> > ret = aarch64_insn_patch_text_nosync(addrs[0], insns[0]);
> > - kick_all_cpus_sync();
> > + kick_active_cpus_sync();
> > return ret;
> > }
> > }
> > diff --git a/include/linux/smp.h b/include/linux/smp.h
> > index 9fb239e12b82..27215e22240d 100644
> > --- a/include/linux/smp.h
> > +++ b/include/linux/smp.h
> > @@ -105,6 +105,7 @@ int smp_call_function_any(const struct cpumask *mask,
> > smp_call_func_t func, void *info, int wait);
> >
> > void kick_all_cpus_sync(void);
> > +void kick_active_cpus_sync(void);
> > void wake_up_all_idle_cpus(void);
> >
> > /*
> > @@ -161,6 +162,7 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
> > }
> >
> > static inline void kick_all_cpus_sync(void) { }
> > +static inline void kick_active_cpus_sync(void) { }
> > static inline void wake_up_all_idle_cpus(void) { }
> >
> > #ifdef CONFIG_UP_LATE_INIT
> > diff --git a/kernel/smp.c b/kernel/smp.c
> > index 084c8b3a2681..0358d6673850 100644
> > --- a/kernel/smp.c
> > +++ b/kernel/smp.c
> > @@ -724,6 +724,30 @@ void kick_all_cpus_sync(void)
> > }
> > EXPORT_SYMBOL_GPL(kick_all_cpus_sync);
> >
> > +/**
> > + * kick_active_cpus_sync - Force CPUs that are not in extended
> > + * quiescent state (idle or nohz_full userspace) sync by sending
> > + * IPI. Extended quiescent state CPUs will sync at the exit of
> > + * that state.
> > + */
> > +void kick_active_cpus_sync(void)
> > +{
> > + int cpu;
> > + struct cpumask kernel_cpus;
> > +
> > + smp_mb();
> > +
> > + cpumask_clear(&kernel_cpus);
> > + preempt_disable();
> > + for_each_online_cpu(cpu) {
> > + if (!rcu_eqs_special_set(cpu))
>
> If we get here, the CPU is not in a quiescent state, so we therefore
> must IPI it, correct?
>
> But don't you also need to define rcu_eqs_special_exit() so that RCU
> can invoke it when it next leaves its quiescent state? Or are you able
> to ignore the CPU in that case? (If you are able to ignore the CPU in
> that case, I could give you a lower-cost function to get your job done.)
>
> Thanx, Paul
What's actually needed for synchronization is issuing memory barrier on target
CPUs before we start executing kernel code.
smp_mb() is implicitly called in smp_call_function*() path for it. In
rcu_eqs_special_set() -> rcu_dynticks_eqs_exit() path, smp_mb__after_atomic()
is called just before rcu_eqs_special_exit().
So I think, rcu_eqs_special_exit() may be left untouched. Empty
rcu_eqs_special_exit() in new RCU path corresponds empty do_nothing() in old
IPI path.
Or my understanding of smp_mb__after_atomic() is wrong? By default,
smp_mb__after_atomic() is just alias to smp_mb(). But some
architectures define it differently. x86, for example, aliases it to
just barrier() with a comment: "Atomic operations are already
serializing on x86".
I was initially thinking that it's also fine to leave
rcu_eqs_special_exit() empty in this case, but now I'm not sure...
Anyway, answering to your question, we shouldn't ignore quiescent
CPUs, and rcu_eqs_special_set() path is really needed as it issues
memory barrier on them.
Yury
> > + cpumask_set_cpu(cpu, &kernel_cpus);
> > + }
> > + smp_call_function_many(&kernel_cpus, do_nothing, NULL, 1);
> > + preempt_enable();
> > +}
> > +EXPORT_SYMBOL_GPL(kick_active_cpus_sync);
> > +
> > /**
> > * wake_up_all_idle_cpus - break all cpus out of idle
> > * wake_up_all_idle_cpus try to break all cpus which is in idle state even
> > diff --git a/mm/slab.c b/mm/slab.c
> > index 324446621b3e..678d5dbd6f46 100644
> > --- a/mm/slab.c
> > +++ b/mm/slab.c
> > @@ -3856,7 +3856,7 @@ static int __do_tune_cpucache(struct kmem_cache *cachep, int limit,
> > * cpus, so skip the IPIs.
> > */
> > if (prev)
> > - kick_all_cpus_sync();
> > + kick_active_cpus_sync();
> >
> > check_irq_on();
> > cachep->batchcount = batchcount;
> > --
> > 2.14.1
> >
^ permalink raw reply
* Re: powerpc/64s: Fix i-side SLB miss bad address handler saving nonvolatile GPRs
From: Michael Ellerman @ 2018-03-25 20:52 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20180323055338.7066-1-npiggin@gmail.com>
On Fri, 2018-03-23 at 05:53:38 UTC, Nicholas Piggin wrote:
> The SLB bad address handler's trap number fixup does not preserve the
> low bit that indicates nonvolatile GPRs have not been saved. This
> leads save_nvgprs to skip saving them, and subsequent functions and
> return from interrupt will think they are saved.
>
> This causes kernel branch-to-garbage debugging to not have correct
> registers, can also cause userspace to have its registers clobbered
> after a segfault.
>
> Fixes: f0f558b131 ("powerpc/mm: Preserve CFAR value on SLB miss caused by access to bogus address")
> Cc: Paul Mackerras <paulus@ozlabs.org>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
I added:
Cc: stable@vger.kernel.org # v4.9+
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/52396500f97c53860164debc7d4f75
cheers
^ permalink raw reply
* Re: PCI set flag PCI_SCAN_ALL_PCIE_DEVS for P.A. Semi boards
From: Darren Stevens @ 2018-03-25 20:55 UTC (permalink / raw)
To: Michael Ellerman
Cc: Bjorn Helgaas, Christian Zigotzky, Bjorn Helgaas, linux-pci,
Olof Johansson, linuxppc-dev
In-Reply-To: <87tvtbg0i9.fsf@concordia.ellerman.id.au>
Hello Michael
On 20/03/2018, Michael Ellerman wrote:
>> The patch looks fine, but I need a signed-off-by line before I can apply
>> it. See https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst
>
> I'm happy to take it, I've been meaning to check if Olof sent a SOB in
> his original mail but haven't got to it.
If thats the way you want to go... We still have an out-of-tree patch we need to apply, which I think is the right place for this. In fact I submitted some patches at the end of last year with a cleaned up version (including the above patch). Here are links:
https://patchwork.ozlabs.org/patch/854270/
https://patchwork.ozlabs.org/patch/854269/
https://patchwork.ozlabs.org/patch/854271/
https://patchwork.ozlabs.org/patch/854268/
These seem to have been missed somehow. (I intended them for 4.16)
If these are suitable, the only thing left would be the pasemi i2c bus patch, which keeps getting ignored by the i2c guys.
Regards
Darren
^ permalink raw reply
* Re: [PATCH v9 01/24] mm: Introduce CONFIG_SPECULATIVE_PAGE_FAULT
From: David Rientjes @ 2018-03-25 21:50 UTC (permalink / raw)
To: Laurent Dufour
Cc: paulmck, peterz, akpm, kirill, ak, mhocko, dave, jack,
Matthew Wilcox, benh, mpe, paulus, Thomas Gleixner, Ingo Molnar,
hpa, Will Deacon, Sergey Senozhatsky, Andrea Arcangeli,
Alexei Starovoitov, kemi.wang, sergey.senozhatsky.work,
Daniel Jordan, linux-kernel, linux-mm, haren, khandual, npiggin,
bsingharora, Tim Chen, linuxppc-dev, x86
In-Reply-To: <1520963994-28477-2-git-send-email-ldufour@linux.vnet.ibm.com>
On Tue, 13 Mar 2018, Laurent Dufour wrote:
> This configuration variable will be used to build the code needed to
> handle speculative page fault.
>
> By default it is turned off, and activated depending on architecture
> support.
>
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
> ---
> mm/Kconfig | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index abefa573bcd8..07c566c88faf 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -759,3 +759,6 @@ config GUP_BENCHMARK
> performance of get_user_pages_fast().
>
> See tools/testing/selftests/vm/gup_benchmark.c
> +
> +config SPECULATIVE_PAGE_FAULT
> + bool
Should this be configurable even if the arch supports it?
^ permalink raw reply
* Re: [PATCH v9 04/24] mm: Prepare for FAULT_FLAG_SPECULATIVE
From: David Rientjes @ 2018-03-25 21:50 UTC (permalink / raw)
To: Laurent Dufour
Cc: paulmck, peterz, akpm, kirill, ak, mhocko, dave, jack,
Matthew Wilcox, benh, mpe, paulus, Thomas Gleixner, Ingo Molnar,
hpa, Will Deacon, Sergey Senozhatsky, Andrea Arcangeli,
Alexei Starovoitov, kemi.wang, sergey.senozhatsky.work,
Daniel Jordan, linux-kernel, linux-mm, haren, khandual, npiggin,
bsingharora, Tim Chen, linuxppc-dev, x86
In-Reply-To: <1520963994-28477-5-git-send-email-ldufour@linux.vnet.ibm.com>
On Tue, 13 Mar 2018, Laurent Dufour wrote:
> From: Peter Zijlstra <peterz@infradead.org>
>
> When speculating faults (without holding mmap_sem) we need to validate
> that the vma against which we loaded pages is still valid when we're
> ready to install the new PTE.
>
> Therefore, replace the pte_offset_map_lock() calls that (re)take the
> PTL with pte_map_lock() which can fail in case we find the VMA changed
> since we started the fault.
>
Based on how its used, I would have suspected this to be named
pte_map_trylock().
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
>
> [Port to 4.12 kernel]
> [Remove the comment about the fault_env structure which has been
> implemented as the vm_fault structure in the kernel]
> [move pte_map_lock()'s definition upper in the file]
> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
> ---
> include/linux/mm.h | 1 +
> mm/memory.c | 56 ++++++++++++++++++++++++++++++++++++++----------------
> 2 files changed, 41 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 4d02524a7998..2f3e98edc94a 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -300,6 +300,7 @@ extern pgprot_t protection_map[16];
> #define FAULT_FLAG_USER 0x40 /* The fault originated in userspace */
> #define FAULT_FLAG_REMOTE 0x80 /* faulting for non current tsk/mm */
> #define FAULT_FLAG_INSTRUCTION 0x100 /* The fault was during an instruction fetch */
> +#define FAULT_FLAG_SPECULATIVE 0x200 /* Speculative fault, not holding mmap_sem */
>
> #define FAULT_FLAG_TRACE \
> { FAULT_FLAG_WRITE, "WRITE" }, \
I think FAULT_FLAG_SPECULATIVE should be introduced in the patch that
actually uses it.
> diff --git a/mm/memory.c b/mm/memory.c
> index e0ae4999c824..8ac241b9f370 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -2288,6 +2288,13 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
> }
> EXPORT_SYMBOL_GPL(apply_to_page_range);
>
> +static bool pte_map_lock(struct vm_fault *vmf)
inline?
> +{
> + vmf->pte = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd,
> + vmf->address, &vmf->ptl);
> + return true;
> +}
> +
> /*
> * handle_pte_fault chooses page fault handler according to an entry which was
> * read non-atomically. Before making any commitment, on those architectures
> @@ -2477,6 +2484,7 @@ static int wp_page_copy(struct vm_fault *vmf)
> const unsigned long mmun_start = vmf->address & PAGE_MASK;
> const unsigned long mmun_end = mmun_start + PAGE_SIZE;
> struct mem_cgroup *memcg;
> + int ret = VM_FAULT_OOM;
>
> if (unlikely(anon_vma_prepare(vma)))
> goto oom;
> @@ -2504,7 +2512,11 @@ static int wp_page_copy(struct vm_fault *vmf)
> /*
> * Re-check the pte - we dropped the lock
> */
> - vmf->pte = pte_offset_map_lock(mm, vmf->pmd, vmf->address, &vmf->ptl);
> + if (!pte_map_lock(vmf)) {
> + mem_cgroup_cancel_charge(new_page, memcg, false);
> + ret = VM_FAULT_RETRY;
> + goto oom_free_new;
> + }
Ugh, but we aren't oom here, so maybe rename oom_free_new so that it makes
sense for return values other than VM_FAULT_OOM?
> if (likely(pte_same(*vmf->pte, vmf->orig_pte))) {
> if (old_page) {
> if (!PageAnon(old_page)) {
> @@ -2596,7 +2608,7 @@ static int wp_page_copy(struct vm_fault *vmf)
> oom:
> if (old_page)
> put_page(old_page);
> - return VM_FAULT_OOM;
> + return ret;
> }
>
> /**
> @@ -2617,8 +2629,8 @@ static int wp_page_copy(struct vm_fault *vmf)
> int finish_mkwrite_fault(struct vm_fault *vmf)
> {
> WARN_ON_ONCE(!(vmf->vma->vm_flags & VM_SHARED));
> - vmf->pte = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd, vmf->address,
> - &vmf->ptl);
> + if (!pte_map_lock(vmf))
> + return VM_FAULT_RETRY;
> /*
> * We might have raced with another page fault while we released the
> * pte_offset_map_lock.
> @@ -2736,8 +2748,11 @@ static int do_wp_page(struct vm_fault *vmf)
> get_page(vmf->page);
> pte_unmap_unlock(vmf->pte, vmf->ptl);
> lock_page(vmf->page);
> - vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,
> - vmf->address, &vmf->ptl);
> + if (!pte_map_lock(vmf)) {
> + unlock_page(vmf->page);
> + put_page(vmf->page);
> + return VM_FAULT_RETRY;
> + }
> if (!pte_same(*vmf->pte, vmf->orig_pte)) {
> unlock_page(vmf->page);
> pte_unmap_unlock(vmf->pte, vmf->ptl);
> @@ -2947,8 +2962,10 @@ int do_swap_page(struct vm_fault *vmf)
> * Back out if somebody else faulted in this pte
> * while we released the pte lock.
> */
Comment needs updating, pte_same() isn't the only reason to bail out here.
> - vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,
> - vmf->address, &vmf->ptl);
> + if (!pte_map_lock(vmf)) {
> + delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
> + return VM_FAULT_RETRY;
> + }
> if (likely(pte_same(*vmf->pte, vmf->orig_pte)))
> ret = VM_FAULT_OOM;
> delayacct_clear_flag(DELAYACCT_PF_SWAPIN);
Not crucial, but it would be nice if this could do goto out instead,
otherwise this is the first mid function return.
> @@ -3003,8 +3020,11 @@ int do_swap_page(struct vm_fault *vmf)
> /*
> * Back out if somebody else already faulted in this pte.
> */
Same as above.
> - vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address,
> - &vmf->ptl);
> + if (!pte_map_lock(vmf)) {
> + ret = VM_FAULT_RETRY;
> + mem_cgroup_cancel_charge(page, memcg, false);
> + goto out_page;
> + }
> if (unlikely(!pte_same(*vmf->pte, vmf->orig_pte)))
> goto out_nomap;
>
mem_cgroup_try_charge() is done before grabbing pte_offset_map_lock(), why
does the out_nomap exit path do mem_cgroup_cancel_charge();
pte_unmap_unlock()? If the pte lock can be droppde first, there's no need
to embed the mem_cgroup_cancel_charge() here.
> @@ -3133,8 +3153,8 @@ static int do_anonymous_page(struct vm_fault *vmf)
> !mm_forbids_zeropage(vma->vm_mm)) {
> entry = pte_mkspecial(pfn_pte(my_zero_pfn(vmf->address),
> vma->vm_page_prot));
> - vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd,
> - vmf->address, &vmf->ptl);
> + if (!pte_map_lock(vmf))
> + return VM_FAULT_RETRY;
> if (!pte_none(*vmf->pte))
> goto unlock;
> ret = check_stable_address_space(vma->vm_mm);
> @@ -3169,8 +3189,11 @@ static int do_anonymous_page(struct vm_fault *vmf)
> if (vma->vm_flags & VM_WRITE)
> entry = pte_mkwrite(pte_mkdirty(entry));
>
> - vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address,
> - &vmf->ptl);
> + if (!pte_map_lock(vmf)) {
> + mem_cgroup_cancel_charge(page, memcg, false);
> + put_page(page);
> + return VM_FAULT_RETRY;
> + }
> if (!pte_none(*vmf->pte))
> goto release;
>
This is more spaghetti, can the exit path be fixed up so we order things
consistently for all gotos?
> @@ -3294,8 +3317,9 @@ static int pte_alloc_one_map(struct vm_fault *vmf)
> * pte_none() under vmf->ptl protection when we return to
> * alloc_set_pte().
> */
> - vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address,
> - &vmf->ptl);
> + if (!pte_map_lock(vmf))
> + return VM_FAULT_RETRY;
> +
> return 0;
> }
>
^ permalink raw reply
* Re: [PATCH v9 05/24] mm: Introduce pte_spinlock for FAULT_FLAG_SPECULATIVE
From: David Rientjes @ 2018-03-25 21:50 UTC (permalink / raw)
To: Laurent Dufour
Cc: paulmck, peterz, akpm, kirill, ak, mhocko, dave, jack,
Matthew Wilcox, benh, mpe, paulus, Thomas Gleixner, Ingo Molnar,
hpa, Will Deacon, Sergey Senozhatsky, Andrea Arcangeli,
Alexei Starovoitov, kemi.wang, sergey.senozhatsky.work,
Daniel Jordan, linux-kernel, linux-mm, haren, khandual, npiggin,
bsingharora, Tim Chen, linuxppc-dev, x86
In-Reply-To: <1520963994-28477-6-git-send-email-ldufour@linux.vnet.ibm.com>
On Tue, 13 Mar 2018, Laurent Dufour wrote:
> When handling page fault without holding the mmap_sem the fetch of the
> pte lock pointer and the locking will have to be done while ensuring
> that the VMA is not touched in our back.
>
> So move the fetch and locking operations in a dedicated function.
>
> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
> ---
> mm/memory.c | 15 +++++++++++----
> 1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 8ac241b9f370..21b1212a0892 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -2288,6 +2288,13 @@ int apply_to_page_range(struct mm_struct *mm, unsigned long addr,
> }
> EXPORT_SYMBOL_GPL(apply_to_page_range);
>
> +static bool pte_spinlock(struct vm_fault *vmf)
inline?
> +{
> + vmf->ptl = pte_lockptr(vmf->vma->vm_mm, vmf->pmd);
> + spin_lock(vmf->ptl);
> + return true;
> +}
> +
> static bool pte_map_lock(struct vm_fault *vmf)
> {
> vmf->pte = pte_offset_map_lock(vmf->vma->vm_mm, vmf->pmd,
Shouldn't pte_unmap_same() take struct vm_fault * and use the new
pte_spinlock()?
^ permalink raw reply
* Re: [mm] b1f0502d04: INFO:trying_to_register_non-static_key
From: David Rientjes @ 2018-03-25 22:10 UTC (permalink / raw)
To: Laurent Dufour
Cc: kernel test robot, paulmck, peterz, akpm, kirill, ak, mhocko,
dave, jack, Matthew Wilcox, benh, mpe, paulus, Thomas Gleixner,
Ingo Molnar, hpa, Will Deacon, Sergey Senozhatsky,
Andrea Arcangeli, Alexei Starovoitov, kemi.wang,
sergey.senozhatsky.work, Daniel Jordan, linux-kernel, linux-mm,
haren, khandual, npiggin, bsingharora, Tim Chen, linuxppc-dev,
x86, lkp
In-Reply-To: <792c0f75-7e7f-cd81-44ae-4205f6e4affc@linux.vnet.ibm.com>
On Wed, 21 Mar 2018, Laurent Dufour wrote:
> I found the root cause of this lockdep warning.
>
> In mmap_region(), unmap_region() may be called while vma_link() has not been
> called. This happens during the error path if call_mmap() failed.
>
> The only to fix that particular case is to call
> seqcount_init(&vma->vm_sequence) when initializing the vma in mmap_region().
>
Ack, although that would require a fixup to dup_mmap() as well.
^ permalink raw reply
* [PATCH v2 00/16] Generic infrastructure for unloading initramfs
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
In-Reply-To: <20180324174458.26423-1-shea@shealevy.com>
This patch series extracts out code for unloading the initramfs that
was identical across 14 architectures, and moves those architectures
to the common code path. Additionally, RISC-V is newly moved to the
common code path.
In addition to reducing duplication, this allows us to bring future
improvements (such as generalizing existing "keep initrd" command line
options) to multiple architectures at once.
v2: Mark generic free_initrd_mem __init.
^ permalink raw reply
* [PATCH v2 01/16] initrd: Add generic code path for common initrd unloading logic.
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
init/initramfs.c | 7 +++++++
usr/Kconfig | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/init/initramfs.c b/init/initramfs.c
index 7e99a0038942..5f2e3dba4822 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -526,6 +526,13 @@ extern unsigned long __initramfs_size;
#include <linux/initrd.h>
#include <linux/kexec.h>
+#ifdef CONFIG_INITRAMFS_GENERIC_UNLOAD
+void __init free_initrd_mem(unsigned long start, unsigned long end)
+{
+ free_reserved_area((void *)start, (void *)end, -1, "initrd");
+}
+#endif
+
static void __init free_initrd(void)
{
#ifdef CONFIG_KEXEC_CORE
diff --git a/usr/Kconfig b/usr/Kconfig
index 43658b8a975e..fd79d4d6fa26 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -233,3 +233,7 @@ config INITRAMFS_COMPRESSION
default ".lzma" if RD_LZMA
default ".bz2" if RD_BZIP2
default ""
+
+# Arches can select this for a generic initrd unloading codepath
+config INITRAMFS_GENERIC_UNLOAD
+ bool
--
2.16.2
^ permalink raw reply related
* [PATCH v2 02/16] riscv: Use INITRAMFS_GENERIC_UNLOAD.
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/riscv/Kconfig | 1 +
arch/riscv/mm/init.c | 6 ------
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c22ebe08e902..ab1b4cee84fc 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -37,6 +37,7 @@ config RISCV
select THREAD_INFO_IN_TASK
select RISCV_TIMER
select GENERIC_IRQ_MULTI_HANDLER
+ select INITRAMFS_GENERIC_UNLOAD
config MMU
def_bool y
diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index c77df8142be2..36f83fe8a726 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -62,9 +62,3 @@ void free_initmem(void)
{
free_initmem_default(0);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */
--
2.16.2
^ permalink raw reply related
* [PATCH v2 03/16] alpha: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/alpha/Kconfig | 1 +
arch/alpha/mm/init.c | 8 --------
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index e96adcbcab41..238d743ae8f2 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -27,6 +27,7 @@ config ALPHA
select ODD_RT_SIGACTION
select OLD_SIGSUSPEND
select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
+ select INITRAMFS_GENERIC_UNLOAD
help
The Alpha is a 64-bit general-purpose processor designed and
marketed by the Digital Equipment Corporation of blessed memory,
diff --git a/arch/alpha/mm/init.c b/arch/alpha/mm/init.c
index 9d74520298ab..55f7c8efa962 100644
--- a/arch/alpha/mm/init.c
+++ b/arch/alpha/mm/init.c
@@ -291,11 +291,3 @@ free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void
-free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
^ permalink raw reply related
* [PATCH v2 04/16] arc: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/arc/Kconfig | 1 +
arch/arc/mm/init.c | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index d76bf4a83740..2844ce5b910c 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -44,6 +44,7 @@ config ARC
select HAVE_GENERIC_DMA_COHERENT
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_LZMA
+ select INITRAMFS_GENERIC_UNLOAD
config MIGHT_HAVE_PCI
bool
diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
index ba145065c579..7bcf23ab1756 100644
--- a/arch/arc/mm/init.c
+++ b/arch/arc/mm/init.c
@@ -229,10 +229,3 @@ void __ref free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
^ permalink raw reply related
* [PATCH v2 05/16] c6x: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/c6x/Kconfig | 1 +
arch/c6x/mm/init.c | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/c6x/Kconfig b/arch/c6x/Kconfig
index c6b4dd1418b4..857f95f9a6a4 100644
--- a/arch/c6x/Kconfig
+++ b/arch/c6x/Kconfig
@@ -19,6 +19,7 @@ config C6X
select GENERIC_CLOCKEVENTS
select MODULES_USE_ELF_RELA
select ARCH_NO_COHERENT_DMA_MMAP
+ select INITRAMFS_GENERIC_UNLOAD
config MMU
def_bool n
diff --git a/arch/c6x/mm/init.c b/arch/c6x/mm/init.c
index 4cc72b0d1c1d..a11cb657182a 100644
--- a/arch/c6x/mm/init.c
+++ b/arch/c6x/mm/init.c
@@ -66,13 +66,6 @@ void __init mem_init(void)
mem_init_print_info(NULL);
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __init free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
^ permalink raw reply related
* [PATCH v2 06/16] frv: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/frv/Kconfig | 1 +
arch/frv/mm/init.c | 11 -----------
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index af369b05fed5..5c104b800cb1 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -17,6 +17,7 @@ config FRV
select OLD_SIGACTION
select HAVE_DEBUG_STACKOVERFLOW
select ARCH_NO_COHERENT_DMA_MMAP
+ select INITRAMFS_GENERIC_UNLOAD
config CPU_BIG_ENDIAN
def_bool y
diff --git a/arch/frv/mm/init.c b/arch/frv/mm/init.c
index cf464100e838..345edc4dc462 100644
--- a/arch/frv/mm/init.c
+++ b/arch/frv/mm/init.c
@@ -131,14 +131,3 @@ void free_initmem(void)
free_initmem_default(-1);
#endif
} /* end free_initmem() */
-
-/*****************************************************************************/
-/*
- * free the initial ramdisk memory
- */
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-} /* end free_initrd_mem() */
-#endif
--
2.16.2
^ permalink raw reply related
* [PATCH v2 07/16] h8300: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/h8300/Kconfig | 1 +
arch/h8300/mm/init.c | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 091d6d04b5e5..58c9b6b1df16 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -24,6 +24,7 @@ config H8300
select HAVE_ARCH_HASH
select CPU_NO_EFFICIENT_FFS
select DMA_DIRECT_OPS
+ select INITRAMFS_GENERIC_UNLOAD
config CPU_BIG_ENDIAN
def_bool y
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index 015287ac8ce8..37574332b202 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -102,13 +102,6 @@ void __init mem_init(void)
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void
free_initmem(void)
{
--
2.16.2
^ permalink raw reply related
* [PATCH v2 08/16] m32r: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/m32r/Kconfig | 1 +
arch/m32r/mm/init.c | 11 -----------
2 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index dd84ee194579..010a2b999181 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -21,6 +21,7 @@ config M32R
select CPU_NO_EFFICIENT_FFS
select DMA_DIRECT_OPS
select ARCH_NO_COHERENT_DMA_MMAP if !MMU
+ select INITRAMFS_GENERIC_UNLOAD
config SBUS
bool
diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 93abc8c3a46e..e2b5f09209ee 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -139,14 +139,3 @@ void free_initmem(void)
{
free_initmem_default(-1);
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-/*======================================================================*
- * free_initrd_mem() :
- * orig : arch/sh/mm/init.c
- *======================================================================*/
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
^ permalink raw reply related
* [PATCH v2 09/16] m68k: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/m68k/Kconfig | 1 +
arch/m68k/mm/init.c | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 785612b576f7..47913a68529e 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -24,6 +24,7 @@ config M68K
select MODULES_USE_ELF_RELA
select OLD_SIGSUSPEND3
select OLD_SIGACTION
+ select INITRAMFS_GENERIC_UNLOAD
config CPU_BIG_ENDIAN
def_bool y
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index e85acd131fa8..e20bef09258c 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -172,10 +172,3 @@ void __init mem_init(void)
mem_init_print_info(NULL);
print_memmap();
}
-
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
--
2.16.2
^ permalink raw reply related
* [PATCH v2 10/16] microblaze: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/microblaze/Kconfig | 1 +
arch/microblaze/mm/init.c | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 3817a3e2146c..ef23e8410b4b 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -36,6 +36,7 @@ config MICROBLAZE
select TRACING_SUPPORT
select VIRT_TO_BUS
select CPU_NO_EFFICIENT_FFS
+ select INITRAMFS_GENERIC_UNLOAD
# Endianness selection
choice
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index df6de7ccdc2e..ea058dfda222 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -187,13 +187,6 @@ void __init setup_memory(void)
paging_init();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
^ permalink raw reply related
* [PATCH v2 11/16] nios2: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/nios2/Kconfig | 1 +
arch/nios2/mm/init.c | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig
index 3d4ec88f1db1..d3b72d5c8967 100644
--- a/arch/nios2/Kconfig
+++ b/arch/nios2/Kconfig
@@ -19,6 +19,7 @@ config NIOS2
select SPARSE_IRQ
select USB_ARCH_HAS_HCD if USB_SUPPORT
select CPU_NO_EFFICIENT_FFS
+ select INITRAMFS_GENERIC_UNLOAD
config GENERIC_CSUM
def_bool y
diff --git a/arch/nios2/mm/init.c b/arch/nios2/mm/init.c
index c92fe4234009..3df75ff8c768 100644
--- a/arch/nios2/mm/init.c
+++ b/arch/nios2/mm/init.c
@@ -82,13 +82,6 @@ void __init mmu_init(void)
flush_tlb_all();
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void __init free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void __ref free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
^ permalink raw reply related
* [PATCH v2 12/16] openrisc: Use INITRAMFS_GENERIC_UNLOAD
From: Shea Levy @ 2018-03-25 22:18 UTC (permalink / raw)
To: linux-alpha, linux-kernel, linux-snps-arc, linux-c6x-dev,
uclinux-h8-devel, linux-m68k, nios2-dev, openrisc, linux-parisc,
linuxppc-dev, linux-riscv, linux-sh, user-mode-linux-devel
Cc: Shea Levy
In-Reply-To: <20180325221853.10839-1-shea@shealevy.com>
Signed-off-by: Shea Levy <shea@shealevy.com>
---
arch/openrisc/Kconfig | 1 +
arch/openrisc/mm/init.c | 7 -------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig
index dfb6a79ba7ff..0f8d2132baa5 100644
--- a/arch/openrisc/Kconfig
+++ b/arch/openrisc/Kconfig
@@ -36,6 +36,7 @@ config OPENRISC
select OMPIC if SMP
select ARCH_WANT_FRAME_POINTERS
select GENERIC_IRQ_MULTI_HANDLER
+ select INITRAMFS_GENERIC_UNLOAD
config CPU_BIG_ENDIAN
def_bool y
diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c
index 6972d5d6f23f..c1a3dcf9ad40 100644
--- a/arch/openrisc/mm/init.c
+++ b/arch/openrisc/mm/init.c
@@ -222,13 +222,6 @@ void __init mem_init(void)
return;
}
-#ifdef CONFIG_BLK_DEV_INITRD
-void free_initrd_mem(unsigned long start, unsigned long end)
-{
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
-}
-#endif
-
void free_initmem(void)
{
free_initmem_default(-1);
--
2.16.2
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox