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

Re: [XEN PATCH v4] xen/arinc653: fix delay in the start of major frame


  • To: Anderson Choi <anderson.choi@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
  • Date: Thu, 24 Jul 2025 21:28:37 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=boeing.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NXUxFZ9qfxdPooQPW6ImcbmEIQKyxHh+zF+JxJPMTUE=; b=SRFGknswOtB26KKoPita3t5Cqf/hukcETfyAvZfqFquhuYhobnnnWB6AZBjSmMaOP1juaNPHZPRZMHo5SQDdRYAaZLzknBiZGn1gNpYbqdPPutWbOK+FMB/JjBugVZZN1PMeLhPk1wqa+KO5OEUtIUwDGqHiGq1H1UJMFElfc8cdLSa3laFFW8JTDFRnMG9l+9jSX7co/Zk1EtBQEcGH51Z+I65Lguqosx0MLCXayRKgJYlhkcBydB9ebxlPifI45ZJCiCCWnLOHtSpNewgnKYTriVPsTaA9PV+OSvnE39rmXmUfZzWrXX5ogAdJh3Vm9MzJ9E4ffgUg3Qh42Cb9Sg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C5Bv46FaVgT+RJ8Bep1JagUn2HnxRLDOI8Ek4W0sRaVskoX4RA5SSt9J9KO8J1zYogewi6vEzksyP3A46ZJu84k2dyL6VhIkIIpq5O6wYteL1/KEdeP6YEmWoLrJKNE3AjxIQAP/zOQXjzIskKttXYjxM98BiY4xMgE7gJBVbpvIMMyuYUy2nM24H9gl/OBXpfeJeqDiYPHldghTzYzwm3U0OQbCzW4Q92e3yctVArcMwYYMlgR4gMkWhDAPc5XIm2aMBLVJEu/QobOU8ctqK9CEFqiwIS3JzicBqzSKedD/gzTBz/t4URfUh5nBcVEanfvSu1UPCCbbSsdLEVqNXQ==
  • Cc: <matthew.l.weber3@xxxxxxxxxx>, <joshua.c.whitehead@xxxxxxxxxx>, "Nathan Studer" <nathan.studer@xxxxxxxxxxxxxxx>, Stewart Hildebrand <stewart@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, "George Dunlap" <gwd@xxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 25 Jul 2025 01:28:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 7/24/25 18:33, Anderson Choi wrote:
> ARINC653 specification requires partition scheduling to be deterministic
> and periodic over time.
> 
> However, the use of current timestamp (now) as the baseline to calculate
> next_major_frame and next_switch_time introduces a delay in the start of
> major frame at every period, which breaks determinism and periodicity in
> partition scheduling.
> 
> For example, we observe 3.5 msec of accumulated delay at the 21st major
> frame with the following configuration.
> 
> Target : qemuarm64
> xen version : 4.19 (43aeacff86, x86/IRQ: constrain creator-domain-ID 
> assertion)
> dom1 : 10 msec runtime
> dom2 : 10 msec runtime
> 
> $ a653_sched -p Pool-arinc dom1:10 dom2:10
> 
> 0.014553536 ---x d?v? runstate_change d1v0 runnable->running //1st major
> frame
> 0.034629712 ---x d?v? runstate_change d1v0 runnable->running //2nd major
> frame
> <snip>
> 0.397747008 |||x d?v? runstate_change d1v0 runnable->running //20th
> major frame
> 0.418066096 -||x d?v? runstate_change d1v0 runnable->running //21st
> major frame
> 
> This is due to an inherent delta between the time value the scheduler timer
> is programmed to be fired with and the time value the schedule function
> is executed.
> 
> Another observation that breaks the deterministic behavior of partition
> scheduling is a delayed execution of schedule(); It was called 14 msec
> later than programmed.
> 
> 1.530603952 ---x d?v? runstate_change d1v0 runnable->running
> 1.564956784 --|x d?v? runstate_change d1v0 runnable->running
> 
> Enforce the periodic behavior of partition scheduling by using the value
> next_major_frame as the base to calculate the start of major frame and
> the next domain switch time.
> 
> Per discussion with Nathan Studer, there are odd cases the first minor
> frame can be also missed. In that scenario, iterate through the schedule
> after resyncing the expected next major frame.
> 
> Per suggestion from Stewart Hildebrand, use a modulo operation to
> calculate the start of next major frame.
> 
> Fixes: 22787f2e107c ("ARINC 653 scheduler")
> Suggested-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
> Suggested-by: Nathan Studer <nathan.studer@xxxxxxxxxxxxxxx>
> Signed-off-by: Anderson Choi <anderson.choi@xxxxxxxxxx>

Reviewed-by: Stewart Hildebrand <stewart@xxxxxxx>



 


Rackspace

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