[PATCH] lib: Increase default memory assigned to the appliance.
Alternate way to fix test-255-disks.sh running out of memory. See previous discussion here: https://www.redhat.com/archives/libguestfs/2018-May/msg00082.html Rich.
With recent Linux kernels, adding and partitioning 255 disks causes the appliance to run out of memory. This causes a test failure in tests/disks/test-255-disks.sh. This change gives the appliance enough memory to complete the test. --- lib/guestfs-internal.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h index adeb9478a..83eaebe75 100644 --- a/lib/guestfs-internal.h +++ b/lib/guestfs-internal.h @@ -94,7 +94,7 @@ * creating device nodes. */ #ifdef __powerpc__ -# define DEFAULT_MEMSIZE 768 +# define DEFAULT_MEMSIZE 1024 # define MIN_MEMSIZE 256 #endif @@ -104,16 +104,16 @@ * common on aarch64, treat this like the ppc case above. */ #ifdef __aarch64__ -# define DEFAULT_MEMSIZE 768 +# define DEFAULT_MEMSIZE 1024 # define MIN_MEMSIZE 256 #endif /* The default and minimum memory size for most users. */ #ifndef DEFAULT_MEMSIZE -# define DEFAULT_MEMSIZE 500 +# define DEFAULT_MEMSIZE 768 #endif #ifndef MIN_MEMSIZE -# define MIN_MEMSIZE 128 +# define MIN_MEMSIZE 256 #endif /* Timeout waiting for appliance to come up (seconds). -- 2.15.1
On Wed, May 16, 2018 at 01:43:09PM +0100, Richard W.M. Jones wrote:
With recent Linux kernels, adding and partitioning 255 disks causes the appliance to run out of memory. This causes a test failure in tests/disks/test-255-disks.sh. This change gives the appliance enough memory to complete the test. --- lib/guestfs-internal.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h index adeb9478a..83eaebe75 100644 --- a/lib/guestfs-internal.h +++ b/lib/guestfs-internal.h @@ -94,7 +94,7 @@ * creating device nodes. */ #ifdef __powerpc__ -# define DEFAULT_MEMSIZE 768 +# define DEFAULT_MEMSIZE 1024 # define MIN_MEMSIZE 256
We could also remove this definition of MIN_MEMSIZE, and ...
#endif
@@ -104,16 +104,16 @@ * common on aarch64, treat this like the ppc case above. */ #ifdef __aarch64__ -# define DEFAULT_MEMSIZE 768 +# define DEFAULT_MEMSIZE 1024 # define MIN_MEMSIZE 256
... this one too since it will be set below.
#endif
/* The default and minimum memory size for most users. */ #ifndef DEFAULT_MEMSIZE -# define DEFAULT_MEMSIZE 500 +# define DEFAULT_MEMSIZE 768 #endif #ifndef MIN_MEMSIZE -# define MIN_MEMSIZE 128 +# define MIN_MEMSIZE 256 #endif
Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On Wednesday, 16 May 2018 14:43:09 CEST Richard W.M. Jones wrote:
With recent Linux kernels, adding and partitioning 255 disks causes the appliance to run out of memory. This causes a test failure in tests/disks/test-255-disks.sh. This change gives the appliance enough memory to complete the test.
TBH raising the amount of memory only for those tests is the solution IMHO, since they are very corner cases, and thus it makes sense for them to require extra work. In any case, the current default of memory seems fine for the majority of the use cases, so I'd delay the default change only if strictly needed to work in "usual workloads". -- Pino Toscano
I wonder why not to set required amount of memory using guestfs_set_memsize or setting LIBGUESTFS_MEMSIZE environment variable just for this test? -- +380979184774 Mykola Ivanets ср, 23 трав. 2018 о 11:28 Pino Toscano <ptoscano@redhat.com> пише:
On Wednesday, 16 May 2018 14:43:09 CEST Richard W.M. Jones wrote:
With recent Linux kernels, adding and partitioning 255 disks causes the appliance to run out of memory. This causes a test failure in tests/disks/test-255-disks.sh. This change gives the appliance enough memory to complete the test.
TBH raising the amount of memory only for those tests is the solution IMHO, since they are very corner cases, and thus it makes sense for them to require extra work. In any case, the current default of memory seems fine for the majority of the use cases, so I'd delay the default change only if strictly needed to work in "usual workloads".
-- Pino Toscano_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
On Wednesday, 23 May 2018 10:48:22 CEST Nikolay Ivanets wrote:
I wonder why not to set required amount of memory using guestfs_set_memsize or setting LIBGUESTFS_MEMSIZE environment variable just for this test?
That was Rich's v1: https://www.redhat.com/archives/libguestfs/2018-May/msg00082.html -- Pino Toscano
participants (3)
-
Nikolay Ivanets -
Pino Toscano -
Richard W.M. Jones