All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tmem: default to off
@ 2019-01-09  9:05 Jan Beulich
  2019-01-09 15:02 ` Roger Pau Monne
  2019-01-09 17:16 ` Wei Liu
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Beulich @ 2019-01-09  9:05 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall

As a short term alternative to deleting the code, default its building
to off (overridable in EXPERT mode only). Additionally make sure other
related baggage (LZO code) won't be carried when the option is off (with
TMEM scheduled to be deleted anyway, I didn't want to introduce a
separate Kconfig option to control the LZO compression code, and hence
CONFIG_TMEM is used directly there). Similarly I couldn't be bothered to
add actual content to the command line option doc for the two affected
options.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
While not posted previously, this is meant to be considered a
replacement for the TMEM removal patch, which was posted in time. I
therefore would like to see this allowed in for 4.12.

--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1969,9 +1969,15 @@ pages) must also be specified via the tb
 ### tmem
 > `= <boolean>`
 
+This option (and its underlying code) is going to go away in a future
+Xen version.
+
 ### tmem_compress
 > `= <boolean>`
 
+This option (and its underlying code) is going to go away in a future
+Xen version.
+
 ### tsc (x86)
 > `= unstable | skewed | stable:socket`
 
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -78,17 +78,19 @@ config KEXEC
 	  If unsure, say Y.
 
 config TMEM
-	def_bool y
-	prompt "Transcendent Memory Support" if EXPERT = "y"
+	bool "Transcendent Memory Support (deprecated)" if EXPERT = "y"
 	---help---
 	  Transcendent memory allows PV-aware guests to collaborate on memory
 	  usage. Guests can 'swap' their memory to the hypervisor or have an
 	  collective pool of memory shared across guests. The end result is
 	  less memory usage by guests allowing higher guest density.
 
-	  You also have to enable it on the Xen commandline by using tmem=1
+	  You also have to enable it on the Xen commandline by using tmem=1.
 
-	  If unsure, say Y.
+	  WARNING: This option (and its underlying code) is going to go away
+	  in a future Xen version.
+
+	  If unsure, say N.
 
 config XENOPROF
 	def_bool y
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_KEXEC) += kimage.o
 obj-y += lib.o
 obj-$(CONFIG_NEEDS_LIST_SORT) += list_sort.o
 obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
-obj-y += lzo.o
+obj-$(CONFIG_TMEM) += lzo.o
 obj-$(CONFIG_MEM_ACCESS) += mem_access.o
 obj-y += memory.o
 obj-y += monitor.o
@@ -66,8 +66,9 @@ obj-bin-y += warning.init.o
 obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o
 
-obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
-
+lzo-y := lzo
+lzo-$(CONFIG_TMEM) :=
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma $(lzo-y) unlzo unlz4 earlycpio,$(n).init.o)
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o kernel.o memory.o multicall.o xlat.o)
 
--- a/xen/common/lzo.c
+++ b/xen/common/lzo.c
@@ -105,6 +105,8 @@
 #define get_unaligned_le16(_p) (*(u16 *)(_p))
 #define get_unaligned_le32(_p) (*(u32 *)(_p))
 
+#ifdef CONFIG_TMEM
+
 static noinline size_t
 lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
                     unsigned char *out, size_t *out_len,
@@ -362,6 +364,11 @@ int lzo1x_1_compress(const unsigned char
     return LZO_E_OK;
 }
 
+# define INIT
+#else /* CONFIG_TMEM */
+# include "decompress.h"
+#endif /* CONFIG_TMEM */
+
 /*
  *  LZO1X Decompressor from LZO
  *
@@ -391,8 +398,8 @@ int lzo1x_1_compress(const unsigned char
  */
 #define MAX_255_COUNT      ((((size_t)~0) / 255) - 2)
 
-int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
-                          unsigned char *out, size_t *out_len)
+int INIT lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
+                               unsigned char *out, size_t *out_len)
 {
     unsigned char *op;
     const unsigned char *ip;





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] tmem: default to off
       [not found] <5C35B94F020000780020BB36@suse.com>
@ 2019-01-09  9:09 ` Juergen Gross
  0 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2019-01-09  9:09 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Andrew Cooper, Ian Jackson, Tim Deegan, Julien Grall

On 09/01/2019 10:05, Jan Beulich wrote:
> As a short term alternative to deleting the code, default its building
> to off (overridable in EXPERT mode only). Additionally make sure other
> related baggage (LZO code) won't be carried when the option is off (with
> TMEM scheduled to be deleted anyway, I didn't want to introduce a
> separate Kconfig option to control the LZO compression code, and hence
> CONFIG_TMEM is used directly there). Similarly I couldn't be bothered to
> add actual content to the command line option doc for the two affected
> options.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> While not posted previously, this is meant to be considered a
> replacement for the TMEM removal patch, which was posted in time. I
> therefore would like to see this allowed in for 4.12.

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] tmem: default to off
  2019-01-09  9:05 [PATCH] tmem: default to off Jan Beulich
@ 2019-01-09 15:02 ` Roger Pau Monne
  2019-01-09 15:27   ` Jan Beulich
  2019-01-09 17:16 ` Wei Liu
  1 sibling, 1 reply; 7+ messages in thread
From: Roger Pau Monne @ 2019-01-09 15:02 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	Andrew Cooper, Tim (Xen.org), George Dunlap, Julien Grall,
	Ian Jackson


Sorry for the wrong formatting.

From: Xen-devel <xen-devel-bounces@lists.xenproject.org> on behalf of Jan Beulich <JBeulich@suse.com>:
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -21,7 +21,7 @@ obj-$(CONFIG_KEXEC) += kimage.o
 obj-y += lib.o
 obj-$(CONFIG_NEEDS_LIST_SORT) += list_sort.o
 obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
-obj-y += lzo.o
+obj-$(CONFIG_TMEM) += lzo.o

Here you completely disable the build of lzo if tmem is not enabled.

 obj-$(CONFIG_MEM_ACCESS) += mem_access.o
 obj-y += memory.o
 obj-y += monitor.o
@@ -66,8 +66,9 @@ obj-bin-y += warning.init.o
 obj-$(CONFIG_XENOPROF) += xenoprof.o
 obj-y += xmalloc_tlsf.o

-obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo unlz4 earlycpio,$(n).init.o)
-
+lzo-y := lzo
+lzo-$(CONFIG_TMEM) :=
+obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma $(lzo-y) unlzo unlz4 earlycpio,$(n).init.o)

Here however you always build unlzo.c, which AFAICT makes use of the lzo1x_decompress_safe function that's defined in lzo.c.

Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] tmem: default to off
  2019-01-09 15:02 ` Roger Pau Monne
@ 2019-01-09 15:27   ` Jan Beulich
  2019-01-09 16:53     ` Roger Pau Monné
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2019-01-09 15:27 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	Andrew Cooper, Tim Deegan, george.dunlap, Julien Grall, xen-devel,
	Ian Jackson

>>> On 09.01.19 at 16:02, <roger.pau@citrix.com> wrote:
> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> on behalf of Jan Beulich 
> <JBeulich@suse.com>:
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -21,7 +21,7 @@ obj-$(CONFIG_KEXEC) += kimage.o
>  obj-y += lib.o
>  obj-$(CONFIG_NEEDS_LIST_SORT) += list_sort.o
>  obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
> -obj-y += lzo.o
> +obj-$(CONFIG_TMEM) += lzo.o
> 
> Here you completely disable the build of lzo if tmem is not enabled.
> 
>  obj-$(CONFIG_MEM_ACCESS) += mem_access.o
>  obj-y += memory.o
>  obj-y += monitor.o
> @@ -66,8 +66,9 @@ obj-bin-y += warning.init.o
>  obj-$(CONFIG_XENOPROF) += xenoprof.o
>  obj-y += xmalloc_tlsf.o
> 
> -obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo 
> unlz4 earlycpio,$(n).init.o)
> -
> +lzo-y := lzo
> +lzo-$(CONFIG_TMEM) :=
> +obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma $(lzo-y) unlzo unlz4 earlycpio,$(n).init.o)
> 
> Here however you always build unlzo.c, which AFAICT makes use of the 
> lzo1x_decompress_safe function that's defined in lzo.c.

Note the (new) definition and use of lzo-y, so together with unlzo.init.o
lzo.init.o will also be built. (I can assure you that I did test with TMEM
enabled and disabled.)

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] tmem: default to off
  2019-01-09 15:27   ` Jan Beulich
@ 2019-01-09 16:53     ` Roger Pau Monné
  0 siblings, 0 replies; 7+ messages in thread
From: Roger Pau Monné @ 2019-01-09 16:53 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	Andrew Cooper, Tim Deegan, George Dunlap, Julien Grall,
	Ian Jackson, xen-devel, Roger Pau Monne

On Wed, Jan 9, 2019 at 4:28 PM Jan Beulich <JBeulich@suse.com> wrote:
>
> >>> On 09.01.19 at 16:02, <roger.pau@citrix.com> wrote:
> > From: Xen-devel <xen-devel-bounces@lists.xenproject.org> on behalf of Jan Beulich
> > <JBeulich@suse.com>:
> > --- a/xen/common/Makefile
> > +++ b/xen/common/Makefile
> > @@ -21,7 +21,7 @@ obj-$(CONFIG_KEXEC) += kimage.o
> >  obj-y += lib.o
> >  obj-$(CONFIG_NEEDS_LIST_SORT) += list_sort.o
> >  obj-$(CONFIG_LIVEPATCH) += livepatch.o livepatch_elf.o
> > -obj-y += lzo.o
> > +obj-$(CONFIG_TMEM) += lzo.o
> >
> > Here you completely disable the build of lzo if tmem is not enabled.
> >
> >  obj-$(CONFIG_MEM_ACCESS) += mem_access.o
> >  obj-y += memory.o
> >  obj-y += monitor.o
> > @@ -66,8 +66,9 @@ obj-bin-y += warning.init.o
> >  obj-$(CONFIG_XENOPROF) += xenoprof.o
> >  obj-y += xmalloc_tlsf.o
> >
> > -obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma unlzo
> > unlz4 earlycpio,$(n).init.o)
> > -
> > +lzo-y := lzo
> > +lzo-$(CONFIG_TMEM) :=
> > +obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma $(lzo-y) unlzo unlz4 earlycpio,$(n).init.o)
> >
> > Here however you always build unlzo.c, which AFAICT makes use of the
> > lzo1x_decompress_safe function that's defined in lzo.c.
>
> Note the (new) definition and use of lzo-y, so together with unlzo.init.o
> lzo.init.o will also be built. (I can assure you that I did test with TMEM
> enabled and disabled.)

Oh sorry, missed it. That makes the lzo parts need when not using tmem
be placed (and checked) to be in the init section.

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] tmem: default to off
  2019-01-09  9:05 [PATCH] tmem: default to off Jan Beulich
  2019-01-09 15:02 ` Roger Pau Monne
@ 2019-01-09 17:16 ` Wei Liu
  2019-01-09 18:28   ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 7+ messages in thread
From: Wei Liu @ 2019-01-09 17:16 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Juergen Gross, Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, xen-devel

On Wed, Jan 09, 2019 at 02:05:19AM -0700, Jan Beulich wrote:
> As a short term alternative to deleting the code, default its building
> to off (overridable in EXPERT mode only). Additionally make sure other
> related baggage (LZO code) won't be carried when the option is off (with
> TMEM scheduled to be deleted anyway, I didn't want to introduce a
> separate Kconfig option to control the LZO compression code, and hence
> CONFIG_TMEM is used directly there). Similarly I couldn't be bothered to
> add actual content to the command line option doc for the two affected
> options.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] tmem: default to off
  2019-01-09 17:16 ` Wei Liu
@ 2019-01-09 18:28   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2019-01-09 18:28 UTC (permalink / raw)
  To: Wei Liu
  Cc: Juergen Gross, Stefano Stabellini, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Julien Grall, Jan Beulich, xen-devel

On Wed, Jan 09, 2019 at 05:16:17PM +0000, Wei Liu wrote:
> On Wed, Jan 09, 2019 at 02:05:19AM -0700, Jan Beulich wrote:
> > As a short term alternative to deleting the code, default its building
> > to off (overridable in EXPERT mode only). Additionally make sure other
> > related baggage (LZO code) won't be carried when the option is off (with
> > TMEM scheduled to be deleted anyway, I didn't want to introduce a
> > separate Kconfig option to control the LZO compression code, and hence
> > CONFIG_TMEM is used directly there). Similarly I couldn't be bothered to
> > add actual content to the command line option doc for the two affected
> > options.
> > 
> > Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>


Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Thank you!

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-01-09 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09  9:05 [PATCH] tmem: default to off Jan Beulich
2019-01-09 15:02 ` Roger Pau Monne
2019-01-09 15:27   ` Jan Beulich
2019-01-09 16:53     ` Roger Pau Monné
2019-01-09 17:16 ` Wei Liu
2019-01-09 18:28   ` Konrad Rzeszutek Wilk
     [not found] <5C35B94F020000780020BB36@suse.com>
2019-01-09  9:09 ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.