[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 3/7] xen/evtchn: restrict the maximum number of evtchn supported for domUs


  • To: Julien Grall <julien@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Tue, 23 Aug 2022 09:41:49 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3lKUlB4fxY4zQzcYaF932ZP5kB3enNdez8RwjKTc+tM=; b=FrWunqRTpkIJZJg1+A+QbNllUKQbS1j3Zn8Y8VsOYRqOVosXRH+6605KHEGPUHiD0ra82MvYctkAtDpFHdSozfBPD2v+NRGnOq5wm/zvNYZpMkhgGTMB6MBFkXOAs29UdnGODZ8+y27w02xkSYlwdJSaapvImA7RBzq3mgfIqzy7cJJEVQYSIpjdhH6MfPd8g+dXT/BEBhiZu99kW/hFXErGwm5vt+llftPhW+EYH/Flx7fmq9MsgmBWGv8Yzueolrc+7zNaKUC18GdkUmZfJ00jUKguVvKn+cdkf1j6A8b4CFbEH/DR+23O4J7AZViQFj1Q7J86+Y83HBeNBkcDmw==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3lKUlB4fxY4zQzcYaF932ZP5kB3enNdez8RwjKTc+tM=; b=LcNQ4DAZ715SxNPOkgCL3cF13x9BnYBJw7RGkuZpNkWqQkNZ7f5PjSs3hDHdifGob4a7mRcG46smuEOT+ll8y30qzXv+6jMT1hB9dRwsL/Fj4pwt3sc9UeAWBVfZzPh3+lKvRGTrYLHezCYY3QyrG9EAyCXQmb+Nr9Z6nd7tDdm4aVd64z0cdDGBJnozLWSzfx96sBKIInteXSZjgPFydk1qtuwof3atb8Phi0vmDtNB5N8qz0rMRxwB9xtk7yynQvAl3ffi97jyTklknLDe+oQF4wIGX8NbyeMaIFwOGPOAwCOcbSss+iI3TTVxqfotixjG3K/QXMsRYQaUgET/4A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=cWwJ8Sc9hGwZbAYg5plDLRvoIzQtPv4APXckpQ/nN+veIWEIBSo3fWZas8tI9sjl9al0OqbnHatmb8gTkaC7rimBtqvP/hboWf5ZHVa1Lp6pKK+bfeSoDxzCPYKOoQ4zsiWr5JLE+k+tACfOh6q6u0VahxePoAwySFnJGGTx1SLrW62EMZlr6EaGmMew3CtY6yKxzVucpKNdVZfkdiEWJov0CXu6NF+W9WfSDVG+X88AenF4fNZm827//DwRNCA88enOew/RfYST5+jwZf8dCFsHo2bZQrLrVBBWQJKoyVMRNwmc3ExubwR6sr6Tevngw7gKVNnQeigmAsYWFSXg+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KSo7gkB/2LQLvbuIktfHW4y1bQh8J/rFhi7S3uazLMyoVNLnm6mHKZHXHUxP+xz/peLHW5f9ovzM5wKttzYsmGY1cQCPNBkbW4kxRPGHm8Fenfqa6m13/jDXoDtEjnSbrbpGfSMR4qXC1faJiWbPv4vCNfHgOCHdTGd1pCGah9fgLgFuNw/RdGkXIFlIftXh2AQ5KCEag+8FgRjxpBbwswZEAajRyRWRzkuGrEUbo7hXrECH2o/JJywl3MaBzv+vig5ZTVz7CJZdSqXVmt3HZJ8b4HPnsX8ICdbgvwfzwWFIscTp/oL5Z7Id7lUxTLRdIhfa0FvlDZH9gOZMJV7bBg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 23 Aug 2022 09:42:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYs7MVCCbVCzB/DU2JPHyjxuVOOK269JmAgAEvmICAAB2KgA==
  • Thread-topic: [PATCH v2 3/7] xen/evtchn: restrict the maximum number of evtchn supported for domUs

Hi Julien,

> On 23 Aug 2022, at 8:56 am, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Rahul and Jan,
> 
> On 22/08/2022 14:49, Jan Beulich wrote:
>> On 19.08.2022 12:02, Rahul Singh wrote:
>>> Static event channel support will be added for dom0less domains.
> 
> I am not sure how this sentence is related to this patch. You...
> 
>>> Restrict the maximum number of evtchn supported for domUs to avoid
>>> allocating a large amount of memory in Xen.
> 
> ... still need the limit to prevent a domain using more memory because at the 
> moment they are unlimited.

Ok. I will remove the sentence.
> 
>> Please clarify here how you arrived at 4096 and why you expect no
>> dom0less DomU would ever want to have more. The limit, after all,
>> is far below that of FIFO event channels.
> 
> I will reply on this because I suggested the limit. A dom0less DomU is 
> exactly the same as a DomU created by the toolstack. The default is 1023 (I 
> originally thought it was 4096).
> 
> I would expect that is 1023 is going to be fine by default also for dom0less 
> domU as on Arm we don't bind physical interrupts to event channels. So the 
> only big use for them is for inter-domain communication.
> 

I will add this information in commit msg.

> Therefore, I think it should be ok to default to 1023 if we want consistency.
> 
> If someone needs more than 1023, we could introduce a per-domain device-tree 
> property to override the default maximum.
> 
>>> --- a/xen/arch/arm/domain_build.c
>>> +++ b/xen/arch/arm/domain_build.c
>>> @@ -3277,7 +3277,7 @@ void __init create_domUs(void)
>>>          struct xen_domctl_createdomain d_cfg = {
>>>              .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
>>>              .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
>>> -            .max_evtchn_port = -1,
>>> +            .max_evtchn_port = MAX_EVTCHNS_PORT,
>>>              .max_grant_frames = -1,
>>>              .max_maptrack_frames = -1,
>>>              .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>>> --- a/xen/include/xen/sched.h
>>> +++ b/xen/include/xen/sched.h
>>> @@ -76,6 +76,9 @@ extern domid_t hardware_domid;
>>>  /* Maximum number of event channels for any ABI. */
>>>  #define MAX_NR_EVTCHNS MAX(EVTCHN_2L_NR_CHANNELS, EVTCHN_FIFO_NR_CHANNELS)
>>>  +/* Maximum number of event channels supported for domUs. */
>>> +#define MAX_EVTCHNS_PORT 4096
>> I'm afraid the variable name doesn't express its purpose, and the
>> comment also claims wider applicability than is actually the case.
>> It's also not clear whether the constant really needs to live in
>> the already heavily overloaded xen/sched.h.
> 
> IMHO, I think the value would be better hardcoded with an explanation on top 
> how we chose the default value.

Ack. 
 
Regards,
Rahul


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.