All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/arm: increase default dom0_mem to 512M
@ 2017-02-15 23:05 Stefano Stabellini
  2017-02-16  9:32 ` Julien Grall
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2017-02-15 23:05 UTC (permalink / raw)
  To: julien.grall; +Cc: xen-devel, sstabellini

The default dom0_mem is 128M which is not sufficient to boot a Ubuntu
based Dom0. Increase it to 512M.

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c97a1f5..f4612a2 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -31,7 +31,7 @@ integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
 
 int dom0_11_mapping = 1;
 
-#define DOM0_MEM_DEFAULT 0x8000000 /* 128 MiB */
+#define DOM0_MEM_DEFAULT 0x20000000 /* 512 MiB */
 static u64 __initdata dom0_mem = DOM0_MEM_DEFAULT;
 
 static void __init parse_dom0_mem(const char *s)

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

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

* Re: [PATCH] xen/arm: increase default dom0_mem to 512M
  2017-02-15 23:05 [PATCH] xen/arm: increase default dom0_mem to 512M Stefano Stabellini
@ 2017-02-16  9:32 ` Julien Grall
  2017-02-16 20:17   ` Stefano Stabellini
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Grall @ 2017-02-16  9:32 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, nd

Hi Stefano,

On 15/02/2017 23:05, Stefano Stabellini wrote:
> The default dom0_mem is 128M which is not sufficient to boot a Ubuntu
> based Dom0. Increase it to 512M.
>
> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>

I am not a big fan of increasing the default value. 128M is plenty 
enough if you use a small DOM0 (e.g buildroot or yocto) and people may 
rely on it because it is the default value in the documentation
(see docs/misc/xen-command-line.markdown).

Also, 512M may boot Ubuntu for you but it might not be the case in all 
the configuration. There is no perfect default value, but I think the 
smaller is better. Looking at the documentation, it looks like x86 is 
using 128MB or 1/16 of the memory (whichever is smaller).

But to be fair, I am not even sure why there is a default value, it is 
quite easy to specify the amount of memory used by DOM0 on the command line.

> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index c97a1f5..f4612a2 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -31,7 +31,7 @@ integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
>
>  int dom0_11_mapping = 1;
>
> -#define DOM0_MEM_DEFAULT 0x8000000 /* 128 MiB */
> +#define DOM0_MEM_DEFAULT 0x20000000 /* 512 MiB */

I would use the MB(..) macro here to make the code more readable.

>  static u64 __initdata dom0_mem = DOM0_MEM_DEFAULT;
>
>  static void __init parse_dom0_mem(const char *s)
>

Cheers,

-- 
Julien Grall

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

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

* Re: [PATCH] xen/arm: increase default dom0_mem to 512M
  2017-02-16  9:32 ` Julien Grall
@ 2017-02-16 20:17   ` Stefano Stabellini
  2017-02-17 15:13     ` Julien Grall
  0 siblings, 1 reply; 5+ messages in thread
From: Stefano Stabellini @ 2017-02-16 20:17 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, nd, Stefano Stabellini

On Thu, 16 Feb 2017, Julien Grall wrote:
> Hi Stefano,
> 
> On 15/02/2017 23:05, Stefano Stabellini wrote:
> > The default dom0_mem is 128M which is not sufficient to boot a Ubuntu
> > based Dom0. Increase it to 512M.
> > 
> > Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> I am not a big fan of increasing the default value. 128M is plenty enough if
> you use a small DOM0 (e.g buildroot or yocto) and people may rely on it
> because it is the default value in the documentation
> (see docs/misc/xen-command-line.markdown).
> 
> Also, 512M may boot Ubuntu for you but it might not be the case in all the
> configuration. There is no perfect default value, but I think the smaller is
> better. Looking at the documentation, it looks like x86 is using 128MB or 1/16
> of the memory (whichever is smaller).
> 
> But to be fair, I am not even sure why there is a default value, it is quite
> easy to specify the amount of memory used by DOM0 on the command line.

This is a topic particularly prone to bike-shedding :-)

Like you wrote, there is no perfect default value. The problem with
128M is that Dom0 will fail to boot without any meaningful errors. I
think it makes for a poor out of the box experience: the user is trying
to boot Xen for the first time on her board, she hasn't customized
much yet, and she has to waste a couple of hours to figure out why Dom0
is crashing.

On the other end, people that are trying to use as little memory as
possible, they are well past the first Xen boot, and they are most
certainly aware of the dom0_mem parameter.

In other words, setting dom0_mem to 128M by default hurts first time
users without helping seasoned users very much.

Rather than having dom0_mem=128M by default, causing a dom0 crash
without any obvious errors, I would rather crash Xen explicitly if
dom0_mem is not set. That way, the user is forced to type in the
dom0_mem parameter and could more easily guess why dom0 is crashing.


> > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> > index c97a1f5..f4612a2 100644
> > --- a/xen/arch/arm/domain_build.c
> > +++ b/xen/arch/arm/domain_build.c
> > @@ -31,7 +31,7 @@ integer_param("dom0_max_vcpus", opt_dom0_max_vcpus);
> > 
> >  int dom0_11_mapping = 1;
> > 
> > -#define DOM0_MEM_DEFAULT 0x8000000 /* 128 MiB */
> > +#define DOM0_MEM_DEFAULT 0x20000000 /* 512 MiB */
> 
> I would use the MB(..) macro here to make the code more readable.

I'll do that


> >  static u64 __initdata dom0_mem = DOM0_MEM_DEFAULT;
> > 
> >  static void __init parse_dom0_mem(const char *s)
> > 


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

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

* Re: [PATCH] xen/arm: increase default dom0_mem to 512M
  2017-02-16 20:17   ` Stefano Stabellini
@ 2017-02-17 15:13     ` Julien Grall
  2017-02-17 23:35       ` Stefano Stabellini
  0 siblings, 1 reply; 5+ messages in thread
From: Julien Grall @ 2017-02-17 15:13 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: xen-devel, nd

Hi Stefano,

On 16/02/17 20:17, Stefano Stabellini wrote:
> On Thu, 16 Feb 2017, Julien Grall wrote:
>> Hi Stefano,
>>
>> On 15/02/2017 23:05, Stefano Stabellini wrote:
>>> The default dom0_mem is 128M which is not sufficient to boot a Ubuntu
>>> based Dom0. Increase it to 512M.
>>>
>>> Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
>>
>> I am not a big fan of increasing the default value. 128M is plenty enough if
>> you use a small DOM0 (e.g buildroot or yocto) and people may rely on it
>> because it is the default value in the documentation
>> (see docs/misc/xen-command-line.markdown).
>>
>> Also, 512M may boot Ubuntu for you but it might not be the case in all the
>> configuration. There is no perfect default value, but I think the smaller is
>> better. Looking at the documentation, it looks like x86 is using 128MB or 1/16
>> of the memory (whichever is smaller).
>>
>> But to be fair, I am not even sure why there is a default value, it is quite
>> easy to specify the amount of memory used by DOM0 on the command line.
>
> This is a topic particularly prone to bike-shedding :-)
>
> Like you wrote, there is no perfect default value. The problem with
> 128M is that Dom0 will fail to boot without any meaningful errors. I
> think it makes for a poor out of the box experience: the user is trying
> to boot Xen for the first time on her board, she hasn't customized
> much yet, and she has to waste a couple of hours to figure out why Dom0
> is crashing.
>
> On the other end, people that are trying to use as little memory as
> possible, they are well past the first Xen boot, and they are most
> certainly aware of the dom0_mem parameter.
>
> In other words, setting dom0_mem to 128M by default hurts first time
> users without helping seasoned users very much.
>
> Rather than having dom0_mem=128M by default, causing a dom0 crash
> without any obvious errors, I would rather crash Xen explicitly if
> dom0_mem is not set. That way, the user is forced to type in the
> dom0_mem parameter and could more easily guess why dom0 is crashing.

Crashing if dom0_mem is not set would be my preferred way. At least we 
won't have a default value that is a bit random. Ubuntu uses 512MB 
today, but who knows tomorrow?

In any case, any change on the command line needs to be documented in 
docs/misc/xen-command-line.markdown.

Cheers,

-- 
Julien Grall

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

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

* Re: [PATCH] xen/arm: increase default dom0_mem to 512M
  2017-02-17 15:13     ` Julien Grall
@ 2017-02-17 23:35       ` Stefano Stabellini
  0 siblings, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2017-02-17 23:35 UTC (permalink / raw)
  To: Julien Grall; +Cc: xen-devel, nd, Stefano Stabellini

On Fri, 17 Feb 2017, Julien Grall wrote:
> Hi Stefano,
> 
> On 16/02/17 20:17, Stefano Stabellini wrote:
> > On Thu, 16 Feb 2017, Julien Grall wrote:
> > > Hi Stefano,
> > > 
> > > On 15/02/2017 23:05, Stefano Stabellini wrote:
> > > > The default dom0_mem is 128M which is not sufficient to boot a Ubuntu
> > > > based Dom0. Increase it to 512M.
> > > > 
> > > > Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
> > > 
> > > I am not a big fan of increasing the default value. 128M is plenty enough
> > > if
> > > you use a small DOM0 (e.g buildroot or yocto) and people may rely on it
> > > because it is the default value in the documentation
> > > (see docs/misc/xen-command-line.markdown).
> > > 
> > > Also, 512M may boot Ubuntu for you but it might not be the case in all the
> > > configuration. There is no perfect default value, but I think the smaller
> > > is
> > > better. Looking at the documentation, it looks like x86 is using 128MB or
> > > 1/16
> > > of the memory (whichever is smaller).
> > > 
> > > But to be fair, I am not even sure why there is a default value, it is
> > > quite
> > > easy to specify the amount of memory used by DOM0 on the command line.
> > 
> > This is a topic particularly prone to bike-shedding :-)
> > 
> > Like you wrote, there is no perfect default value. The problem with
> > 128M is that Dom0 will fail to boot without any meaningful errors. I
> > think it makes for a poor out of the box experience: the user is trying
> > to boot Xen for the first time on her board, she hasn't customized
> > much yet, and she has to waste a couple of hours to figure out why Dom0
> > is crashing.
> > 
> > On the other end, people that are trying to use as little memory as
> > possible, they are well past the first Xen boot, and they are most
> > certainly aware of the dom0_mem parameter.
> > 
> > In other words, setting dom0_mem to 128M by default hurts first time
> > users without helping seasoned users very much.
> > 
> > Rather than having dom0_mem=128M by default, causing a dom0 crash
> > without any obvious errors, I would rather crash Xen explicitly if
> > dom0_mem is not set. That way, the user is forced to type in the
> > dom0_mem parameter and could more easily guess why dom0 is crashing.
> 
> Crashing if dom0_mem is not set would be my preferred way. At least we won't
> have a default value that is a bit random. Ubuntu uses 512MB today, but who
> knows tomorrow?

I have an idea: what if in case dom0_mem is not, we print a warning,
then wait 3 full seconds and continue with a large dom0_mem? That way,
it would be impossible to ignore, but at the same time the user could
fix the problem right away from dom0 as soon as it's booted?

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

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

end of thread, other threads:[~2017-02-17 23:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 23:05 [PATCH] xen/arm: increase default dom0_mem to 512M Stefano Stabellini
2017-02-16  9:32 ` Julien Grall
2017-02-16 20:17   ` Stefano Stabellini
2017-02-17 15:13     ` Julien Grall
2017-02-17 23:35       ` Stefano Stabellini

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.