From nobody Sat Jun 15 02:04:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1666348809; cv=none; d=zohomail.com; s=zohoarc; b=B4xrgqjXaU+9LixbUXX8HKqEUJg/+8fh+ga0PIbyYekxnlz/nSBQ5uYW6FKOrGI9VAIg0Ubz8ZzZ+l5/AZ6rmXwlNLQI6nFMATnjVR4/iG/+5DEJLqJ6OpUhZlRNnuropQUZ9FF/7SZ7eNbfClfszQ7rzVSr1PBuGddLVJZmfTw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666348809; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=SxgbxSMyb0IFJGx0g8YtqshvcZalAQw+dJK/WArNEog=; b=G7YFusc4hmAqM0NdycDVIPrU/51pXozmGH9Myl8VICVaE98PNvKsvbrtkyeVwZQ0AMJ5zwUTtBS2nH0po/CR6BB7+Z6Zi9HWzANo8cFBLW6JL4iZk0XQ86EKaiKQ3ge6cD/PxCR0PDhGjYbVbO0an9m2zevVR3A2zFtgTTOvEdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1666348809597893.8174176636109; Fri, 21 Oct 2022 03:40:09 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.427570.676769 (Exim 4.92) (envelope-from ) id 1olpRN-0006zc-UE; Fri, 21 Oct 2022 10:39:49 +0000 Received: by outflank-mailman (output) from mailman id 427570.676769; Fri, 21 Oct 2022 10:39:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1olpRN-0006zV-Py; Fri, 21 Oct 2022 10:39:49 +0000 Received: by outflank-mailman (input) for mailman id 427570; Fri, 21 Oct 2022 10:39:48 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1olpRM-0006zN-H5 for xen-devel@lists.xenproject.org; Fri, 21 Oct 2022 10:39:48 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id aefc994f-512c-11ed-91b5-6bf2151ebd3b; Fri, 21 Oct 2022 12:39:47 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3D00F222E0; Fri, 21 Oct 2022 10:39:47 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 02E2B1331A; Fri, 21 Oct 2022 10:39:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id IEXQOfJ2UmOQIgAAMHmgww (envelope-from ); Fri, 21 Oct 2022 10:39:46 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: aefc994f-512c-11ed-91b5-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666348787; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SxgbxSMyb0IFJGx0g8YtqshvcZalAQw+dJK/WArNEog=; b=txepUFtSN5gyKNLYR8SWIaXWBdY49vmiII+MfWBoopNd8Y2zNTTyFUfW2GHxYIJq3csZx6 WzW4YPCVzZbOS73PXpu0P0oLBDSmi95iaLP0UDCOG8I3VUVO1a9RMepIgAPeLkBkymXRty FUOnlsXDfjFMF+oCpDAhVjlrzTHNmwM= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Dario Faggioli , Meng Xu , George Dunlap Subject: [PATCH] xen/sched: try harder to find a runnable unit in rt_schedule() Date: Fri, 21 Oct 2022 12:39:45 +0200 Message-Id: <20221021103945.4416-1-jgross@suse.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1666348810261100001 Content-Type: text/plain; charset="utf-8" Instead of directly falling back to the idle unit in case the top unit from the run queue happened to be not runnable, consult the run queue again. Suggested-by: Dario Faggioli Signed-off-by: Juergen Gross Reviewed-by: Dario Faggioli --- xen/common/sched/rt.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c index 960a8033e2..1f8d074884 100644 --- a/xen/common/sched/rt.c +++ b/xen/common/sched/rt.c @@ -1080,15 +1080,20 @@ rt_schedule(const struct scheduler *ops, struct sch= ed_unit *currunit, } else { - snext =3D runq_pick(ops, cpumask_of(sched_cpu), cur_cpu); - - if ( snext =3D=3D NULL ) - snext =3D rt_unit(sched_idle_unit(sched_cpu)); - else if ( !unit_runnable_state(snext->unit) ) + while ( true ) { + snext =3D runq_pick(ops, cpumask_of(sched_cpu), cur_cpu); + + if ( snext =3D=3D NULL ) + { + snext =3D rt_unit(sched_idle_unit(sched_cpu)); + break; + } + if ( unit_runnable_state(snext->unit) ) + break; + q_remove(snext); replq_remove(ops, snext); - snext =3D rt_unit(sched_idle_unit(sched_cpu)); } =20 /* if scurr has higher priority and budget, still pick scurr */ --=20 2.35.3