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

RE: Discussion on the delayed start of major frame with ARINC653 scheduler


  • To: Nathan Studer <Nathan.Studer@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Choi, Anderson" <Anderson.Choi@xxxxxxxxxx>
  • Date: Thu, 10 Jul 2025 06:36:21 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=boeing.com; dmarc=pass action=none header.from=boeing.com; dkim=pass header.d=boeing.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector5401; 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=tBbHhToESV9OiIflD+M4e3ldgnd63HrEvU0Eum6au88=; b=sB4A+B4Lb+3iValxKW1Vr67KNEjUsH+5iBpKUldA3BgHEV3yLOqrDuGoTXUBKd0HzneHB+ROPA7V15FVw+DzEDBtmaEH7yISgd8yTzK5zdV6QXoHTpvjYHlk06NVM6KPLAP+uB6IF4MuxKlxTCdPRzNmTffYp6sn2YzfueeJCGGX6YYa+plqnI1xq19hf5vnsqL4syzGIg82QNgy6CQ/su3qHLf3bh+94Phrgo+jihQfcYjq5y8kQpSXAm71X+RZW9n9f8Q/kzBuc6b9v9WT65hFRE+L+445b/3bbSNEZ71SWrFKAjhW0KHRxIraHKihiBZK3NKlfUPtHSdt1FBmGw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector5401; d=microsoft.com; cv=none; b=Eamz6ajo8iPzEue1Gic8Fyfsy2szny8RWy/UfT2jQRQTBnkxyLxaHtl2tEg6A55Q4rFFstqhlSrIV4eGr+3WYrCe1npV77BLOlwRErV2z3Pe4iTTJ78hcnvBcWBQXYIY2Kqyz+9gH/jIx3S3IMsChVT6L37Wi4uVDBkvJVJtj/Xy2sbEwb4QDB430UYtcNd7ZRqV6cLRFvZ36JwHa4kjPtnPbxFFpNl1qnJ5j/GLhVQ0/VFhMP9vHXV1kLwIslGqu1yR3eOt9aA32hnhEn9KlsC/cv9tyoEMKwspGN+HjgpNUZNwN4O1pI9ErpnzN/Mt55En5eGJCKc2nzCesgK8VQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=boeing.com;
  • Cc: "stewart@xxxxxxx" <stewart@xxxxxxx>, "Weber (US), Matthew L" <matthew.l.weber3@xxxxxxxxxx>, "Whitehead (US), Joshua C" <joshua.c.whitehead@xxxxxxxxxx>, Jeff Kubascik <Jeff.Kubascik@xxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 10 Jul 2025 06:36:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AdvmTXSjjVtbwyT/QSCLI/dKN0kF9QKhMe9AACLJK7A=
  • Thread-topic: Discussion on the delayed start of major frame with ARINC653 scheduler

Nathan,

> I'm not sure this will work if the first minor frame is also missed (which can
> happen in some odd cases).  In that scenario, you need to iterate through the
> schedule after resyncing the expected next major frame.
> 
> Building off your changes, this should work:
> 
> -    if ( sched_priv->num_schedule_entries < 1 )
> -        sched_priv->next_major_frame = now + DEFAULT_TIMESLICE;
> -    else if ( now >= sched_priv->next_major_frame )
> +    /* Switch to next major frame while handling potentially missed frames */
> +    while ( now >= sched_priv->next_major_frame )
>      {
> -        /* time to enter a new major frame
> -         * the first time this function is called, this will be true */
> -        /* start with the first domain in the schedule */
>          sched_priv->sched_index = 0;
> -        sched_priv->next_major_frame = now + sched_priv->major_frame; -
>        sched_priv->next_switch_time = now +
> sched_priv->schedule[0].runtime; -    } -    else -    { -        while
> ( (now >= sched_priv->next_switch_time) && -               
> (sched_priv->sched_index < sched_priv->num_schedule_entries) ) + +      
>  if ( sched_priv->num_schedule_entries < 1 ) +        { +           
> sched_priv->next_major_frame += DEFAULT_TIMESLICE; +           
> sched_priv->next_switch_time = sched_priv->next_major_frame; +        }
> +        else
>          {
> -            /* time to switch to the next domain in this major frame */
> -            sched_priv->sched_index++;
> -            sched_priv->next_switch_time +=
> -                sched_priv->schedule[sched_priv->sched_index].runtime;
> +            sched_priv->next_switch_time = sched_priv->next_major_frame +
> +                sched_priv->schedule[0].runtime;
> +            sched_priv->next_major_frame += sched_priv->major_frame;
>          }
>      }
> +    /* Switch minor frame or find correct minor frame after a miss */
> +    while ( (now >= sched_priv->next_switch_time) &&
> +            (sched_priv->sched_index < sched_priv->num_schedule_entries) )
> +    {
> +        sched_priv->sched_index++;
> +        sched_priv->next_switch_time +=
> +            sched_priv->schedule[sched_priv->sched_index].runtime;
> +    }
> +
> 
> Any chance you could give that a test and see if it fixes your issue?
> 
>> 
>> Can I get your advice on this subject?
>> 
>> Should you have any questions about the description, please let me know.
>> 
>> Here are the details to reproduce the issue on QEMUARM64.
> 
> I assume you are also running on hardware, but just a warning that testing 
> real
> time scheduling on qemu can be a frustrating experience.
> 
>      Nate
>> 

I appreciate your suggestion on this subject.
I'm also running xen on real hardware but qemu seems to provide worse cases to 
debug such as delayed timer interrupt and its effect.
The change you suggested works perfect and solves the issue I have observed.
As you have pointed out, my change will let the first domain run too long in 
case the first minor frame is missed, giving no chances for other domains in 
the major frame to get scheduled.

What would be the next step? Will you submit the patch or should I revise the 
patch I have already submitted with the change you suggested?

https://patchwork.kernel.org/project/xen-devel/patch/26f4fb409f03cb221a98692c4f291756d9cc26ae.1751948342.git.anderson.choi@xxxxxxxxxx/

Thanks,
Anderson





 


Rackspace

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