Xen-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
@ 2020-03-26  9:45 Juergen Gross
  2020-03-26  9:54 ` Jan Beulich
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Juergen Gross @ 2020-03-26  9:45 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, Anthony PERARD, Ian Jackson, Wei Liu

Today the maximum number of event channels for a guest is defaulting
to 1023. For large guests with lots of vcpus this is not enough, as
e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
guest to about 140 vcpus.

Instead of requiring to specify the allowed number of event channels
via the "event_channels" domain config option, make the default
depend on the maximum number of vcpus of the guest.

In order not to regress current configs use 1023 as the minimum
default setting.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libxl/libxl_create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e7cb2dbc2b..eddd0e98e5 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -226,7 +226,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             b_info->iomem[i].gfn = b_info->iomem[i].start;
 
     if (!b_info->event_channels)
-        b_info->event_channels = 1023;
+        b_info->event_channels = min(1023, b_info->max_vcpus * 8 + 255);
 
     libxl__arch_domain_build_info_setdefault(gc, b_info);
     libxl_defbool_setdefault(&b_info->dm_restrict, false);
-- 
2.16.4



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

* Re: [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
  2020-03-26  9:45 [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus Juergen Gross
@ 2020-03-26  9:54 ` Jan Beulich
  2020-03-26 10:00   ` Jürgen Groß
  2020-03-26 10:29 ` Jürgen Groß
  2020-03-26 12:36 ` Andrew Cooper
  2 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2020-03-26  9:54 UTC (permalink / raw)
  To: Juergen Gross; +Cc: Anthony PERARD, xen-devel, Ian Jackson, Wei Liu

On 26.03.2020 10:45, Juergen Gross wrote:
> Today the maximum number of event channels for a guest is defaulting
> to 1023. For large guests with lots of vcpus this is not enough, as
> e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
> guest to about 140 vcpus.

I don't think any particular guest OS should "dictate" the default
here. What if another OS (or even a future version of Linux) requires
more than 8? And why would the value depend on number of vCPU-s but
not number and kind of virtual devices?

Jan


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

* Re: [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
  2020-03-26  9:54 ` Jan Beulich
@ 2020-03-26 10:00   ` Jürgen Groß
  2020-03-26 10:05     ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Jürgen Groß @ 2020-03-26 10:00 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Anthony PERARD, xen-devel, Ian Jackson, Wei Liu

On 26.03.20 10:54, Jan Beulich wrote:
> On 26.03.2020 10:45, Juergen Gross wrote:
>> Today the maximum number of event channels for a guest is defaulting
>> to 1023. For large guests with lots of vcpus this is not enough, as
>> e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
>> guest to about 140 vcpus.
> 
> I don't think any particular guest OS should "dictate" the default
> here. What if another OS (or even a future version of Linux) requires
> more than 8? And why would the value depend on number of vCPU-s but
> not number and kind of virtual devices?

It is a rough estimate. And with HVM guests being limited to 128 cpus
anyway, this problem is more relevant for PV guests, limiting the
available options for guest OS's.

You can always specify a larger value in the guest config after all.


Juergen


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

* Re: [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
  2020-03-26 10:00   ` Jürgen Groß
@ 2020-03-26 10:05     ` Jan Beulich
  2020-03-26 10:11       ` Jürgen Groß
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Beulich @ 2020-03-26 10:05 UTC (permalink / raw)
  To: Jürgen Groß; +Cc: Anthony PERARD, xen-devel, Ian Jackson, Wei Liu

On 26.03.2020 11:00, Jürgen Groß wrote:
> On 26.03.20 10:54, Jan Beulich wrote:
>> On 26.03.2020 10:45, Juergen Gross wrote:
>>> Today the maximum number of event channels for a guest is defaulting
>>> to 1023. For large guests with lots of vcpus this is not enough, as
>>> e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
>>> guest to about 140 vcpus.
>>
>> I don't think any particular guest OS should "dictate" the default
>> here. What if another OS (or even a future version of Linux) requires
>> more than 8? And why would the value depend on number of vCPU-s but
>> not number and kind of virtual devices?
> 
> It is a rough estimate. And with HVM guests being limited to 128 cpus
> anyway, this problem is more relevant for PV guests, limiting the
> available options for guest OS's.

How many evtchns would e.g. mini-os require? I.e. wouldn't such stubdoms
get a much larger than necessary allowance this way?

Jan


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

* Re: [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
  2020-03-26 10:05     ` Jan Beulich
@ 2020-03-26 10:11       ` Jürgen Groß
  0 siblings, 0 replies; 8+ messages in thread
From: Jürgen Groß @ 2020-03-26 10:11 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Anthony PERARD, xen-devel, Ian Jackson, Wei Liu

On 26.03.20 11:05, Jan Beulich wrote:
> On 26.03.2020 11:00, Jürgen Groß wrote:
>> On 26.03.20 10:54, Jan Beulich wrote:
>>> On 26.03.2020 10:45, Juergen Gross wrote:
>>>> Today the maximum number of event channels for a guest is defaulting
>>>> to 1023. For large guests with lots of vcpus this is not enough, as
>>>> e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
>>>> guest to about 140 vcpus.
>>>
>>> I don't think any particular guest OS should "dictate" the default
>>> here. What if another OS (or even a future version of Linux) requires
>>> more than 8? And why would the value depend on number of vCPU-s but
>>> not number and kind of virtual devices?
>>
>> It is a rough estimate. And with HVM guests being limited to 128 cpus
>> anyway, this problem is more relevant for PV guests, limiting the
>> available options for guest OS's.
> 
> How many evtchns would e.g. mini-os require? I.e. wouldn't such stubdoms
> get a much larger than necessary allowance this way?

mini-os doesn't support SMP. So (if not configured with lots of vcpus,
which doesn't make sense) they still get 1023 event channels per
default. Which is much more as they need, but the same as today.

Xenstore stubdom is unlimited like dom0, BTW.


Juergen


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

* Re: [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
  2020-03-26  9:45 [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus Juergen Gross
  2020-03-26  9:54 ` Jan Beulich
@ 2020-03-26 10:29 ` Jürgen Groß
  2020-03-26 12:36 ` Andrew Cooper
  2 siblings, 0 replies; 8+ messages in thread
From: Jürgen Groß @ 2020-03-26 10:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 26.03.20 10:45, Juergen Gross wrote:
> Today the maximum number of event channels for a guest is defaulting
> to 1023. For large guests with lots of vcpus this is not enough, as
> e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
> guest to about 140 vcpus.
> 
> Instead of requiring to specify the allowed number of event channels
> via the "event_channels" domain config option, make the default
> depend on the maximum number of vcpus of the guest.
> 
> In order not to regress current configs use 1023 as the minimum
> default setting.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>   tools/libxl/libxl_create.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index e7cb2dbc2b..eddd0e98e5 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -226,7 +226,7 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
>               b_info->iomem[i].gfn = b_info->iomem[i].start;
>   
>       if (!b_info->event_channels)
> -        b_info->event_channels = 1023;
> +        b_info->event_channels = min(1023, b_info->max_vcpus * 8 + 255);

Sorry, forgot to do "stg refresh", this should be max(), of course.


Juergen


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

* Re: [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
  2020-03-26  9:45 [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus Juergen Gross
  2020-03-26  9:54 ` Jan Beulich
  2020-03-26 10:29 ` Jürgen Groß
@ 2020-03-26 12:36 ` Andrew Cooper
  2020-03-26 12:42   ` Jürgen Groß
  2 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2020-03-26 12:36 UTC (permalink / raw)
  To: Juergen Gross, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 26/03/2020 09:45, Juergen Gross wrote:
> Today the maximum number of event channels for a guest is defaulting
> to 1023. For large guests with lots of vcpus this is not enough, as
> e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
> guest to about 140 vcpus.
>
> Instead of requiring to specify the allowed number of event channels
> via the "event_channels" domain config option, make the default
> depend on the maximum number of vcpus of the guest.
>
> In order not to regress current configs use 1023 as the minimum
> default setting.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>

:(

I suspect I regressed this by making it not actually dead code.

1023 is the 32bit EVT 2L ABI limit, but until I moved max_evtchn into
the createdomain hypercall, I'm pretty sure a limit never used to get set.

If this is the case, then unlimited should be the default.

~Andrew


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

* Re: [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus
  2020-03-26 12:36 ` Andrew Cooper
@ 2020-03-26 12:42   ` Jürgen Groß
  0 siblings, 0 replies; 8+ messages in thread
From: Jürgen Groß @ 2020-03-26 12:42 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel; +Cc: Anthony PERARD, Ian Jackson, Wei Liu

On 26.03.20 13:36, Andrew Cooper wrote:
> On 26/03/2020 09:45, Juergen Gross wrote:
>> Today the maximum number of event channels for a guest is defaulting
>> to 1023. For large guests with lots of vcpus this is not enough, as
>> e.g. the Linux kernel uses 7 event channels per vcpu, limiting the
>> guest to about 140 vcpus.
>>
>> Instead of requiring to specify the allowed number of event channels
>> via the "event_channels" domain config option, make the default
>> depend on the maximum number of vcpus of the guest.
>>
>> In order not to regress current configs use 1023 as the minimum
>> default setting.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> :(
> 
> I suspect I regressed this by making it not actually dead code.
> 
> 1023 is the 32bit EVT 2L ABI limit, but until I moved max_evtchn into
> the createdomain hypercall, I'm pretty sure a limit never used to get set.

In 4.11 I'm seeing it being set via xc_domain_set_max_evtchn().


Juergen



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

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26  9:45 [Xen-devel] [PATCH] tools/libxl: make default of max event channels dependant on vcpus Juergen Gross
2020-03-26  9:54 ` Jan Beulich
2020-03-26 10:00   ` Jürgen Groß
2020-03-26 10:05     ` Jan Beulich
2020-03-26 10:11       ` Jürgen Groß
2020-03-26 10:29 ` Jürgen Groß
2020-03-26 12:36 ` Andrew Cooper
2020-03-26 12:42   ` Jürgen Groß

Xen-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/xen-devel/0 xen-devel/git/0.git
	git clone --mirror https://lore.kernel.org/xen-devel/1 xen-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 xen-devel xen-devel/ https://lore.kernel.org/xen-devel \
		xen-devel@lists.xenproject.org xen-devel@lists.xen.org
	public-inbox-index xen-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.xenproject.lists.xen-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git