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

RE: [PATCH-for-4.17] xen/sched: fix race in RTDS scheduler


  • To: Juergen Gross <jgross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Fri, 21 Oct 2022 06:14:18 +0000
  • Accept-language: zh-CN, 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=TKMx7cjayhGES3G8jN+5b5BKkccbaSW3tboBnzSFJRg=; b=PIpnclx+SSmCg9aHql2MiX6F/qPNAbNBUFpu8tfDZQE4StAVVabA0GDZc1nfanOgKr3TcftCR+ZYAYYk5CABPuP4lLCdOXkty/tek0mBGLdGQMXwIdWInx8TVpO+CKumbx+TIS2ipQMJ77ffWjU3jPkhp4Q1039SgmMboPGznWhd7Zk46/LsP8h2wbNCupNXgHVb1zPne3DJ51ygUSoqrZbMeCAErYWG8BYT81oq+64BvBGX49c570RHxOm+wmLvZ0z7xKlobLx4ff2UIvxiTPkDUlFPM/i/w6AJ8TVEHZs/TetfgcbpJbN6tGuIkYbvDWSROxic1/U/MBUbxv+VgQ==
  • 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=TKMx7cjayhGES3G8jN+5b5BKkccbaSW3tboBnzSFJRg=; b=NFYHhHRwzoDZY/iGjDVRmWsU0OSMEJpXXIptxaw3eZk2mNLsFpurNlA/70S1VOkCxwEBf6WzrTcSUbGQgSTa78t6+RVALU4mSSkIEiozwOdnJO6u1zktjYnINuUitWE9HhDmgNFHr7yAgp1TgM0SHLbksdzMA/9GhHAJ0ALfppsaSuIpY7YSGLwCM1tTGyoVyZNwz+XsUciWp4/G/MPFkplKucxNAjIUFJQWwBDBY7zDQXic4jZeqobvXun99TvMLunnPDYkC9QLVyiz+Sx3mZsGNE5EbGxHEbgY/Z7F0BX7VmcNUf+LJYSXpkyxVin4AUfEzsjodxoKLEw1NSMNaA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=a4pjqNJRiMmalQWG1DwTuGWnJXHxlTbtKI0QmSakQnFJxx8/YjsoP5oX0W1OoRJV+vDfjXR7YjJbxoRjCSMzFYZeJzwZKdvb94uhakjOpw6Di0MtLapRGbmovAn6Pn0H0/2ojxYonysVMDj3jAv1Vp1QXHIpx906L4eOnHJiZsmPKh8Aghs1Xhw2wJoMRVdUoSQU/p6UGaUURhPjfRJJKxXBtpJQhSdcsNprouVMFXxiTnPSoDDMPmbnQJM3noeGSEqjTqXFGcLgl/AmiysVhVNH7KTDBNqzvUDcKCFXPUWqvBJtHJFMFQWw+Lm1UyIXHVG5TkwX1DwU+Z4ZxVutRg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FkZgtrRVOZZuS1SFAi4nlaJpjsUsJUHMFW+HGIgPGa8JNDpTL93DyfwSMVjOnYWTx89zaBg2yybr568gl4lLliJrcQVWCe1evXsBOWXgCEzIPx7b8fpdOVudQC09aCzFw1B2DfpugC5fg1TtNrN5TXs8zW/CZBFpjbU6ozlQGq2Wz/JMJd36sWjpJCPAxtUgYsbzK8AdpUuXA5W64Wddvc5dPLsfZwP0qzRV/wVO43dJM149kKmDbvlclg8XSqTBquSouarBoWvp+cp7VXaxwE9HAJYFlLdJHyBNniiBXwFzMHwil7tNYQ5L2UAei5E9kbE+x1NtdFTvNDa5kObcBQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Dario Faggioli <dfaggioli@xxxxxxxx>, Meng Xu <mengxu@xxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>
  • Delivery-date: Fri, 21 Oct 2022 06:14:38 +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: AQHY5RPn4YgYN4uuDkuaQs+f2Uthxa4YXmcQ
  • Thread-topic: [PATCH-for-4.17] xen/sched: fix race in RTDS scheduler

Hi Juergen,

> -----Original Message-----
> From: Juergen Gross <jgross@xxxxxxxx>
> Subject: [PATCH-for-4.17] xen/sched: fix race in RTDS scheduler
> 
> When a domain gets paused the unit runnable state can change to "not
> runnable" without the scheduling lock being involved. This means that
> a specific scheduler isn't involved in this change of runnable state.
> 
> In the RTDS scheduler this can result in an inconsistency in case a
> unit is losing its "runnable" capability while the RTDS scheduler's
> scheduling function is active. RTDS will remove the unit from the run
> queue, but doesn't do so for the replenish queue, leading to hitting
> an ASSERT() in replq_insert() later when the domain is unpaused again.
> 
> Fix that by removing the unit from the replenish queue as well in this
> case.
> 
> Fixes: 7c7b407e7772 ("xen/sched: introduce unit_runnable_state()")
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Thanks for the quick fix.

Release-acked-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry

> ---
>  xen/common/sched/rt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
> index d6de25531b..960a8033e2 100644
> --- a/xen/common/sched/rt.c
> +++ b/xen/common/sched/rt.c
> @@ -1087,6 +1087,7 @@ rt_schedule(const struct scheduler *ops, struct
> sched_unit *currunit,
>          else if ( !unit_runnable_state(snext->unit) )
>          {
>              q_remove(snext);
> +            replq_remove(ops, snext);
>              snext = rt_unit(sched_idle_unit(sched_cpu));
>          }
> 
> --
> 2.35.3




 


Rackspace

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