diff mbox series

um: fix time-travel=inf-cpu with xor/raid6

Message ID 20191213100128.04075cf409e9.Id772dc879535c85524c32b81fd392bbbfd515741@changeid
State Accepted
Headers show
Series um: fix time-travel=inf-cpu with xor/raid6 | expand

Commit Message

Johannes Berg Dec. 13, 2019, 9:01 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Today, I erroneously built a time-travel configuration with btrfs
enabled, and noticed it cannot boot in time-travel=inf-cpu mode,
both xor and raid6 speed measurement gets stuck.

For xor, work around it by picking the first algorithm if inf-cpu
mode is enabled.

For raid6, I didn't find such a workaround, so disallow enabling
time-travel mode if RAID6_PQ_BENCHMARK is enabled.

With this, and RAID6_PQ_BENCHMARK disabled, I can boot a kernel
that has btrfs enabled in time-travel=inf-cpu mode.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 arch/um/Kconfig            | 2 ++
 arch/um/include/asm/Kbuild | 1 -
 arch/um/include/asm/xor.h  | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)
 create mode 100644 arch/um/include/asm/xor.h

Comments

Anton Ivanov Dec. 13, 2019, 10:32 a.m. UTC | #1
On 13/12/2019 09:01, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Today, I erroneously built a time-travel configuration with btrfs
> enabled, and noticed it cannot boot in time-travel=inf-cpu mode,
> both xor and raid6 speed measurement gets stuck.
> 
> For xor, work around it by picking the first algorithm if inf-cpu
> mode is enabled.
> 
> For raid6, I didn't find such a workaround, so disallow enabling
> time-travel mode if RAID6_PQ_BENCHMARK is enabled.
> 
> With this, and RAID6_PQ_BENCHMARK disabled, I can boot a kernel
> that has btrfs enabled in time-travel=inf-cpu mode.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>   arch/um/Kconfig            | 2 ++
>   arch/um/include/asm/Kbuild | 1 -
>   arch/um/include/asm/xor.h  | 7 +++++++
>   3 files changed, 9 insertions(+), 1 deletion(-)
>   create mode 100644 arch/um/include/asm/xor.h
> 
> diff --git a/arch/um/Kconfig b/arch/um/Kconfig
> index 2a6d04fcb3e9..a8bf60b5c208 100644
> --- a/arch/um/Kconfig
> +++ b/arch/um/Kconfig
> @@ -188,6 +188,8 @@ config SECCOMP
>   config UML_TIME_TRAVEL_SUPPORT
>   	bool
>   	prompt "Support time-travel mode (e.g. for test execution)"
> +	# inf-cpu mode is incompatible with the benchmarking
> +	depends on !RAID6_PQ_BENCHMARK
>   	help
>   	  Enable this option to support time travel inside the UML instance.
>   
> diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
> index 398006d27e40..db7d9d4e30d8 100644
> --- a/arch/um/include/asm/Kbuild
> +++ b/arch/um/include/asm/Kbuild
> @@ -25,5 +25,4 @@ generic-y += switch_to.h
>   generic-y += topology.h
>   generic-y += trace_clock.h
>   generic-y += word-at-a-time.h
> -generic-y += xor.h
>   generic-y += kprobes.h
> diff --git a/arch/um/include/asm/xor.h b/arch/um/include/asm/xor.h
> new file mode 100644
> index 000000000000..7a3208c47cfc
> --- /dev/null
> +++ b/arch/um/include/asm/xor.h
> @@ -0,0 +1,7 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#include <asm-generic/xor.h>
> +#include <shared/timer-internal.h>
> +
> +/* pick an arbitrary one - measuring isn't possible with inf-cpu */
> +#define XOR_SELECT_TEMPLATE(x)	\
> +	(time_travel_mode == TT_MODE_INFCPU ? &xor_block_8regs : NULL)
> 

Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Richard Weinberger Jan. 19, 2020, 9:35 p.m. UTC | #2
On Fri, Dec 13, 2019 at 11:32 AM Anton Ivanov
<anton.ivanov@kot-begemot.co.uk> wrote:
>
>
>
> On 13/12/2019 09:01, Johannes Berg wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> >
> > Today, I erroneously built a time-travel configuration with btrfs
> > enabled, and noticed it cannot boot in time-travel=inf-cpu mode,
> > both xor and raid6 speed measurement gets stuck.
> >
> > For xor, work around it by picking the first algorithm if inf-cpu
> > mode is enabled.
> >
> > For raid6, I didn't find such a workaround, so disallow enabling
> > time-travel mode if RAID6_PQ_BENCHMARK is enabled.
> >
> > With this, and RAID6_PQ_BENCHMARK disabled, I can boot a kernel
> > that has btrfs enabled in time-travel=inf-cpu mode.
> >
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> > ---
> >   arch/um/Kconfig            | 2 ++
> >   arch/um/include/asm/Kbuild | 1 -
> >   arch/um/include/asm/xor.h  | 7 +++++++
> >   3 files changed, 9 insertions(+), 1 deletion(-)
> >   create mode 100644 arch/um/include/asm/xor.h
> >
> > diff --git a/arch/um/Kconfig b/arch/um/Kconfig
> > index 2a6d04fcb3e9..a8bf60b5c208 100644
> > --- a/arch/um/Kconfig
> > +++ b/arch/um/Kconfig
> > @@ -188,6 +188,8 @@ config SECCOMP
> >   config UML_TIME_TRAVEL_SUPPORT
> >       bool
> >       prompt "Support time-travel mode (e.g. for test execution)"
> > +     # inf-cpu mode is incompatible with the benchmarking
> > +     depends on !RAID6_PQ_BENCHMARK
> >       help
> >         Enable this option to support time travel inside the UML instance.
> >
> > diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
> > index 398006d27e40..db7d9d4e30d8 100644
> > --- a/arch/um/include/asm/Kbuild
> > +++ b/arch/um/include/asm/Kbuild
> > @@ -25,5 +25,4 @@ generic-y += switch_to.h
> >   generic-y += topology.h
> >   generic-y += trace_clock.h
> >   generic-y += word-at-a-time.h
> > -generic-y += xor.h
> >   generic-y += kprobes.h
> > diff --git a/arch/um/include/asm/xor.h b/arch/um/include/asm/xor.h
> > new file mode 100644
> > index 000000000000..7a3208c47cfc
> > --- /dev/null
> > +++ b/arch/um/include/asm/xor.h
> > @@ -0,0 +1,7 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +#include <asm-generic/xor.h>
> > +#include <shared/timer-internal.h>
> > +
> > +/* pick an arbitrary one - measuring isn't possible with inf-cpu */
> > +#define XOR_SELECT_TEMPLATE(x)       \
> > +     (time_travel_mode == TT_MODE_INFCPU ? &xor_block_8regs : NULL)
> >
>
> Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>

Applied. Thanks!
diff mbox series

Patch

diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 2a6d04fcb3e9..a8bf60b5c208 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -188,6 +188,8 @@  config SECCOMP
 config UML_TIME_TRAVEL_SUPPORT
 	bool
 	prompt "Support time-travel mode (e.g. for test execution)"
+	# inf-cpu mode is incompatible with the benchmarking
+	depends on !RAID6_PQ_BENCHMARK
 	help
 	  Enable this option to support time travel inside the UML instance.
 
diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild
index 398006d27e40..db7d9d4e30d8 100644
--- a/arch/um/include/asm/Kbuild
+++ b/arch/um/include/asm/Kbuild
@@ -25,5 +25,4 @@  generic-y += switch_to.h
 generic-y += topology.h
 generic-y += trace_clock.h
 generic-y += word-at-a-time.h
-generic-y += xor.h
 generic-y += kprobes.h
diff --git a/arch/um/include/asm/xor.h b/arch/um/include/asm/xor.h
new file mode 100644
index 000000000000..7a3208c47cfc
--- /dev/null
+++ b/arch/um/include/asm/xor.h
@@ -0,0 +1,7 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+#include <asm-generic/xor.h>
+#include <shared/timer-internal.h>
+
+/* pick an arbitrary one - measuring isn't possible with inf-cpu */
+#define XOR_SELECT_TEMPLATE(x)	\
+	(time_travel_mode == TT_MODE_INFCPU ? &xor_block_8regs : NULL)